jackyon / webpack-browser-plugin

Launch your app after webpack completes building.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm version npm

Webpack Browser Plugin

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: ''

var config = {
  entry: {
    app: __dirname + 'src/pantera.js'
  output: {
    path: __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.

Other Webpack Plugins

Also checkout our other webpack plugin WebpackShellPlugin.


  • port: Port to run on. Default: 8080
  • rul: Url to use. Default:
  • browser: Browser to use. Default: default <string|array>


Launch your app after webpack completes building.


Language:JavaScript 100.0%