{"id":24015035,"url":"https://github.com/1337programming/webpack-browser-plugin","last_synced_at":"2025-04-15T11:44:41.627Z","repository":{"id":66192112,"uuid":"56789520","full_name":"1337programming/webpack-browser-plugin","owner":"1337programming","description":"Launch your app after webpack completes building.","archived":false,"fork":false,"pushed_at":"2016-12-07T19:12:44.000Z","size":68,"stargazers_count":42,"open_issues_count":6,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T19:39:03.615Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1337programming.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-21T16:30:59.000Z","updated_at":"2022-12-01T04:42:03.000Z","dependencies_parsed_at":"2023-02-25T06:45:54.311Z","dependency_job_id":null,"html_url":"https://github.com/1337programming/webpack-browser-plugin","commit_stats":{"total_commits":62,"total_committers":6,"mean_commits":"10.333333333333334","dds":"0.12903225806451613","last_synced_commit":"df51d177a2efe5f1e0e944d821d70e55ecb57a8a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1337programming%2Fwebpack-browser-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1337programming%2Fwebpack-browser-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1337programming%2Fwebpack-browser-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1337programming%2Fwebpack-browser-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1337programming","download_url":"https://codeload.github.com/1337programming/webpack-browser-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248465348,"owners_count":21108244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-08T07:38:41.762Z","updated_at":"2025-04-15T11:44:41.609Z","avatar_url":"https://github.com/1337programming.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/webpack-browser-plugin.svg)](https://badge.fury.io/js/webpack-browser-plugin)\n![](https://reposs.herokuapp.com/?path=1337programming/webpack-browser-plugin)\n[![npm](https://img.shields.io/npm/dm/webpack-browser-plugin.svg)]()\n# Webpack Browser Plugin\n\nThis plugin enables your webpack builds to automatically launch it's application on a browser.\n\nWill automatically work for webpack-dev-server. For standard webpack usage -- browser sync is used to launch the application on a specific port.\n\n## Installation\n\n`npm install --save-dev webpack-browser-plugin`\n\n## Setup\nIn `webpack.config.js`:\n\n```js\nconst WebpackBrowserPlugin = require('webpack-browser-plugin');\n\nmodule.exports = {\n  ...\n  ...\n  plugins: [\n    new WebpackBrowserPlugin()\n  ],\n  ...\n}\n```\n\n\n\n## Example\n\nYou can specify a port and a browser to be used.\n\n```js\nconst WebpackBrowserPlugin = require('webpack-browser-plugin');\n\nvar plugins = [];\n\nplugins.push(new WebpackBrowserPlugin({\n  browser: 'Firefox',\n  port: 9000,\n  url: 'http://192.168.3.1'\n}));\n\nvar config = {\n  entry: {\n    app: __dirname + 'src/pantera.js'\n  },\n  output: {\n    path: __dirname + 'dest'\n  },\n  devServer: {\n    contentBase: __dirname + 'dest'\n  },\n  plugins: plugins,\n  module: {\n    loaders: [\n      {test: /\\.js$/, loaders: 'babel'},\n      {test: /\\.scss$/, loader: 'style!css!scss?'},\n      {test: /\\.html$/, loader: 'html-loader'}\n    ]\n  }\n}\n\nmodule.exports = config;\n```\n\nNote: For `webpack`, `browser-sync` is being used. For `webpack-dev-server` a child process spawns the browser popup.\nAlso ports get overwritten if specified in webpack.config.js for webpack-dev-server.\n\n### Other Webpack Plugins\nAlso checkout our other webpack plugin [WebpackShellPlugin](https://github.com/1337programming/webpack-shell-plugin).\n\n### API\n* `port`: Port to run on. **Default: 8080 \u003cnumber\u003e**\n* `browser`: Browser to use. Note: webpack-dev-server will open your default browser. **Default: default \u003cstring|array\u003e**\n* `url`: Url to use. **Default: http://127.0.0.1 or http://localhost \u003cstring\u003e**\n* `publicPath`: Public url path. Note: this gets overridden by output.publicPath in your webpack.config. **Default: null**\n\n**Webpack-dev-server** only\n* `openOptions`: For webpack-dev-server, we use node module [opn](https://github.com/sindresorhus/opn). WARNING: This will override this plugin and webpack's configurations. **Default: null**\n\n**Webpack** only\n* `bsOptions`: Options to pass to the [browser-sync module](https://browsersync.io/docs/options). WARNING: This will override this plugin and webpack's configurations.  **Default: null**\n\n### Contributing\nCreate a new branch and write your changes in the `src/` folder.\n\nMake sure you run your tests with both `webpack` and `webpack-dev-server`. Or `npm run test` and `npm run test:dev`.\n\nOnce complete run `npm run build` and create your pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1337programming%2Fwebpack-browser-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1337programming%2Fwebpack-browser-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1337programming%2Fwebpack-browser-plugin/lists"}