Skip to content

Commit

Permalink
Merge pull request #32 from chrismayer/optimize-dev-server
Browse files Browse the repository at this point in the history
Optimize dev-server
  • Loading branch information
chrismayer authored Sep 13, 2018
2 parents 4d03e80 + 639902c commit de3b780
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion build/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ devMiddleware.waitUntilValid(() => {
console.log('> Listening at ' + uri + '\n')
// when env is testing, don't need open it
if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
opn(uri)
var opnOpts = {};
if (config.dev.browser) {
opnOpts.app = [config.dev.browser];
}
opn(uri, opnOpts)
}
_resolve()
})
Expand Down
5 changes: 4 additions & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ module.exports = {
},
dev: {
env: require('./dev.env'),
port: 8080,
port: 8081,
// define a special browser to open the dev app (false = default browser)
// 'google chrome' on macOS, 'google-chrome' on Linux and 'chrome' on Win
browser: false,
autoOpenBrowser: true,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"karma-spec-reporter": "0.0.31",
"karma-webpack": "^2.0.9",
"mocha": "^3.5.3",
"opn": "^5.2.0",
"opn": "^5.3.0",
"optimize-css-assets-webpack-plugin": "^2.0.0",
"ora": "^1.2.0",
"phantomjs-prebuilt": "^2.1.16",
Expand Down

0 comments on commit de3b780

Please sign in to comment.