diff --git a/package.json b/package.json index 1fe4552ec0a..1f6813a8bad 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "file-loader": "^0.9.0", "html-webpack-plugin": "^2.22.0", "json-loader": "^0.5.4", + "opn": "^4.0.2", "postcss-loader": "^0.9.1", "rimraf": "^2.5.3", "style-loader": "^0.13.1", diff --git a/scripts/start.js b/scripts/start.js index 6abad4b64c1..477c5ed7c4d 100644 --- a/scripts/start.js +++ b/scripts/start.js @@ -13,6 +13,7 @@ var webpack = require('webpack'); var WebpackDevServer = require('webpack-dev-server'); var config = require('../webpack.config.dev'); var execSync = require('child_process').execSync; +var opn = require('opn'); new WebpackDevServer(webpack(config), { publicPath: config.output.publicPath, @@ -39,10 +40,5 @@ new WebpackDevServer(webpack(config), { } console.log('Listening at http://localhost:3000/'); - try { - execSync('ps cax | grep "Google Chrome"'); - execSync('open -a "Google Chrome" http://localhost:3000/'); - } catch(e) { - // Do nothing if Chrome isn't opened or cannot be opened - } + opn('http://localhost:3000/'); });