Home

Awesome

THIS PACKAGE IS NOT MAINTAINED ANYMORE

Honestly, I started with this just for fun without thinking in the maintenance and I'm really busy with other projects. However, not responding to any request is unrespectful. My apologies for that.

If somebody want to take the ownership of this project, let me know.

Before that, take in consideration that Webpack has evolved a lot and it has the ability to open a page without plugins. Maybe that's enough for your project.

Open Browser Webpack Plugin

Opens a new browser tab when Webpack loads. Very useful if you're lazy and don't want to force yourself to open a new tab when Webpack is ready to play!

Installation

npm install open-browser-webpack-plugin --save-dev

Usage

Simply require the plugin and add it in the plugins section:

var OpenBrowserPlugin = require('open-browser-webpack-plugin');

module.exports = {
  entry: path.resolve(__dirname, 'lib/entry.js'),
  output: {
    path: __dirname + "/bundle/",
    filename: "bundle.js"
  },
  plugins: [
    new OpenBrowserPlugin({ url: 'http://localhost:3000' })
  ]
};

Options

url

Type: String<br> Default: http://localhost:8080

Url to open when Webpack is ready. Needs to have the prefix http:// or https:// in order to open the browser.

delay

Type: Number<br> Default: 0<br> Optional

By default the browser is opened immediately, but this could be too early in some cases (eg. starting a nodeJS server). The value is specified in milliseconds.

browser

Type: String<br> Optional

Browser to open. By default, it will try to open the browser set by default in your system.

ignoreErrors

Type: Boolean<br> Default: False<br> Optional

By default this plugin only opens the browser if there's no Webpack errors. Setting ignoreErrors to true will open a new tab no matter the compilation errors.

Change Log

0.0.5 - 2017-03-09

Fixes

0.0.4 - 2017-02-19

Fixes

0.0.3 - 2016-10-31

Added

0.0.2 - 2015-12-26

Added

Removed

0.0.1 - 2015-09-12

License

MIT License.