File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change 4141 "file-loader" : " ^0.9.0" ,
4242 "html-webpack-plugin" : " ^2.22.0" ,
4343 "json-loader" : " ^0.5.4" ,
44+ "opn" : " ^4.0.2" ,
4445 "postcss-loader" : " ^0.9.1" ,
4546 "rimraf" : " ^2.5.3" ,
4647 "style-loader" : " ^0.13.1" ,
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ var webpack = require('webpack');
1313var WebpackDevServer = require ( 'webpack-dev-server' ) ;
1414var config = require ( '../webpack.config.dev' ) ;
1515var execSync = require ( 'child_process' ) . execSync ;
16+ var opn = require ( 'opn' ) ;
1617
1718new WebpackDevServer ( webpack ( config ) , {
1819 publicPath : config . output . publicPath ,
@@ -39,10 +40,5 @@ new WebpackDevServer(webpack(config), {
3940 }
4041 console . log ( 'Listening at http://localhost:3000/' ) ;
4142
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/' ) ;
4844} ) ;
You can’t perform that action at this time.
0 commit comments