Please add a flag to webpack-dev-server that will automatically open the browser to the configured url.
Can you test if #329 works as you would expect?
should have option to define which browser to use
and is it possible to open open something else?... let's say open /something/else
Is --open exposed to webpack's Node.js API? I would like to do this:
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
inline: true,
stats: { colors: true },
headers: { 'Access-Control-Allow-Origin': '*' },
open: 'http://localhost:8081'
}).listen(8081, 'localhost', function (err, result) {
if (err) {
return console.log(err);
}
console.log('Listening at http://localhost:8081/');
});
@bennyn did you manage to do this ?
In my webpack.config.js:
devServer: {
open: false
}
does not prevent webpack to open app in new page.
I am using webpack 3.6.0 webpack-dev-server 2.9.1
Does it work for anyone?
For me devServer: { open: false } doesn't work either.
@SpaceK33z I'm trying to use the open option on a webpack config via the Node API based on https://webpack.js.org/configuration/dev-server/#devserver-open. However, it won't work. Is this supposed to work outside of the CLI?
@emilio-martinez I face the same problem as you.
Seems that open option is only used in CLI.
The open function that's used to open browser appear only in status function.
All files that use status are in bin directory. That mean it works only in CLI.
So, no way to open browser via Node API. 鈽癸笍
Most helpful comment
should have option to define which browser to use