Giter Club home page Giter Club logo

open-browser-webpack-plugin's Introduction

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
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
Default: 0
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
Optional

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

ignoreErrors

Type: Boolean
Default: False
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

  • Fix issue where the compilation never ends. (Thanks to @vkalinichev)

0.0.4 - 2017-02-19

Fixes

  • Fix issue where other Webpack callbacks were removed. (Thanks to @plemarquand)

0.0.3 - 2016-10-31

Added

  • delay option (Thanks to @Root-Core)

0.0.2 - 2015-12-26

Added

  • ignoreErrors option (Thanks to @zhura).
  • Changelog.
  • Documentation for options.

Removed

  • DEFAULT_BROWSER constant.

0.0.1 - 2015-09-12

  • First release.

License

MIT License.

open-browser-webpack-plugin's People

Contributors

aorrego-huge avatar aorrego-xk avatar baldore avatar nitin42 avatar root-core avatar vkalinichev avatar zhura avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.