
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
webpack-browser-plugin
Advanced tools
This plugin enables your webpack builds to automatically launch it's application on a browser.
Will automatically work for webpack-dev-server. For standard webpack usage -- browser sync is used to launch the application on a specific port.
npm install --save-dev webpack-browser-plugin
In webpack.config.js:
const WebpackBrowserPlugin = require('webpack-browser-plugin');
module.exports = {
...
...
plugins: [
new WebpackBrowserPlugin()
],
...
}
You can specify a port and a browser to be used.
const WebpackBrowserPlugin = require('webpack-browser-plugin');
var plugins = [];
plugins.push(new WebpackBrowserPlugin({
browser: 'Firefox',
port: 9000,
url: 'http://192.168.3.1'
}));
var config = {
entry: {
app: __dirname + 'src/pantera.js'
},
output: {
path: __dirname + 'dest'
},
devServer: {
contentBase: __dirname + 'dest'
},
plugins: plugins,
module: {
loaders: [
{test: /\.js$/, loaders: 'babel'},
{test: /\.scss$/, loader: 'style!css!scss?'},
{test: /\.html$/, loader: 'html-loader'}
]
}
}
module.exports = config;
Note: For webpack, browser-sync is being used. For webpack-dev-server a child process spawns the browser popup.
Also ports get overwritten if specified in webpack.config.js for webpack-dev-server.
Also checkout our other webpack plugin WebpackShellPlugin.
port: Port to run on. Default: 8080 browser: Browser to use. Note: webpack-dev-server will open your default browser. Default: default <string|array>url: Url to use. Default: http://127.0.0.1 or http://localhost publicPath: Public url path. Note: this gets overridden by output.publicPath in your webpack.config. Default: nullWebpack-dev-server only
openOptions: For webpack-dev-server, we use node module opn. WARNING: This will override this plugin and webpack's configurations. Default: nullWebpack only
bsOptions: Options to pass to the browser-sync module. WARNING: This will override this plugin and webpack's configurations. Default: nullCreate a new branch and write your changes in the src/ folder.
Make sure you run your tests with both webpack and webpack-dev-server. Or npm run test and npm run test:dev.
Once complete run npm run build and create your pull request.
FAQs
Launch a browser after webpack-dev-server completes building
We found that webpack-browser-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.