Skip to content

Commit

Permalink
fix: Open correct URL if custom port is supplied (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalduez authored and markdalgleish committed Nov 19, 2018
1 parent 96c8868 commit cd8ef1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/start.js
Expand Up @@ -17,12 +17,13 @@ module.exports = (config, callback) => {

const compiler = webpack(webpackConfig);
const devServer = new WebpackDevServer(compiler, webpackDevServerConfig);
const { port = 9000 } = config;

devServer.listen(config.port || 9000, 'localhost', (...args) => {
devServer.listen(port, 'localhost', (...args) => {
const [err] = args;

if (!err) {
opn('http://localhost:9000');
opn(`http://localhost:${port}`);
}

if (typeof callback === 'function') {
Expand Down

0 comments on commit cd8ef1e

Please sign in to comment.