File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 11[ ![ npm version] ( https://badge.fury.io/js/webpack-browser-plugin.svg )] ( https://badge.fury.io/js/webpack-browser-plugin )
22![ ] ( https://reposs.herokuapp.com/?path=1337programming/webpack-browser-plugin )
33[ ![ npm] ( https://img.shields.io/npm/dm/webpack-browser-plugin.svg )] ( )
4+ # Work In Progress!!
45# Webpack Browser Plugin
56
67This plugin enables your webpack builds to automatically launch it's application on a browser.
Original file line number Diff line number Diff line change @@ -45,7 +45,11 @@ var WebpackShellPlugin = function () {
4545 port : 8080 ,
4646 browser : 'default'
4747 } ;
48- this . options = mergeOptions ( options , defaultOptions ) ;
48+ if ( options ) {
49+ this . options = mergeOptions ( options , defaultOptions ) ;
50+ } else {
51+ this . options = defaultOptions ;
52+ }
4953 }
5054
5155 babelHelpers . createClass ( WebpackShellPlugin , [ {
@@ -59,7 +63,7 @@ var WebpackShellPlugin = function () {
5963 this . options . port = compiler . options . devServer . port ;
6064 }
6165
62- compiler . plugin ( 'done ' , function ( compilation , callback ) {
66+ compiler . plugin ( 'emit ' , function ( compilation , callback ) {
6367 if ( compilation . compiler . _plugins [ 'watch-run' ] ) {
6468 // Running in dev-server @todo check and validate this
6569 var open = require ( 'open' ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,11 @@ export default class WebpackShellPlugin {
1414 port : 8080 ,
1515 browser : 'default'
1616 } ;
17- this . options = mergeOptions ( options , defaultOptions ) ;
17+ if ( options ) {
18+ this . options = mergeOptions ( options , defaultOptions ) ;
19+ } else {
20+ this . options = defaultOptions ;
21+ }
1822 }
1923
2024 apply ( compiler ) {
@@ -24,7 +28,7 @@ export default class WebpackShellPlugin {
2428 this . options . port = compiler . options . devServer . port ;
2529 }
2630
27- compiler . plugin ( 'done ' , ( compilation , callback ) => {
31+ compiler . plugin ( 'emit ' , ( compilation , callback ) => {
2832 if ( compilation . compiler . _plugins [ 'watch-run' ] ) {
2933 // Running in dev-server @todo check and validate this
3034 const open = require ( 'open' ) ;
You can’t perform that action at this time.
0 commit comments