File tree 2 files changed +3
-6
lines changed
2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 41
41
"file-loader" : " ^0.9.0" ,
42
42
"html-webpack-plugin" : " ^2.22.0" ,
43
43
"json-loader" : " ^0.5.4" ,
44
+ "opn" : " ^4.0.2" ,
44
45
"postcss-loader" : " ^0.9.1" ,
45
46
"rimraf" : " ^2.5.3" ,
46
47
"style-loader" : " ^0.13.1" ,
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ var webpack = require('webpack');
13
13
var WebpackDevServer = require ( 'webpack-dev-server' ) ;
14
14
var config = require ( '../webpack.config.dev' ) ;
15
15
var execSync = require ( 'child_process' ) . execSync ;
16
+ var opn = require ( 'opn' ) ;
16
17
17
18
new WebpackDevServer ( webpack ( config ) , {
18
19
publicPath : config . output . publicPath ,
@@ -39,10 +40,5 @@ new WebpackDevServer(webpack(config), {
39
40
}
40
41
console . log ( 'Listening at http://localhost:3000/' ) ;
41
42
42
- try {
43
- execSync ( 'ps cax | grep "Google Chrome"' ) ;
44
- execSync ( 'open -a "Google Chrome" http://localhost:3000/' ) ;
45
- } catch ( e ) {
46
- // Do nothing if Chrome isn't opened or cannot be opened
47
- }
43
+ opn ( 'http://localhost:3000/' ) ;
48
44
} ) ;
You can’t perform that action at this time.
0 commit comments