I\'ve been trying to figure out how to write a npm script that will culminate with the application being launched in the user\'s browser without them having to
For Webpack users: OpenBrowserPlugin does the trick too!
Install one dependency:
npm install open-browser-webpack-plugin --save-dev
And add this in webpack config file:
var OpenBrowserPlugin = require('open-browser-webpack-plugin');
...
plugins: [
new OpenBrowserPlugin({ url: 'http://localhost:3000' })
]
Please note OpenBrowserPlugin is abandoned and a severe vulnerability hasn't been fixed for a while. However rodrigopandini has forked it here. Use npm install rodrigopandini/open-browser-webpack-plugin to use it.