A simple plugin to open the app in browser after compiling the code by webpack
npm install -D opener-for-webpack
const OpenerForWebpack = require('opener-for-webpack');
module.exports = {
entry: "./app.js",
output: {
},
plugins: [
new OpenerForWebpack({url: 'http://localhost:8090'})
]
};
var angularity = require('webpack-angularity-solution');
var opener = require('opener-for-webpack');
const PORT = '3000';
module.exports = angularity(process.env, {port: PORT})
.append(openTheApp)
.otherwise('app+test')
.resolve();
function openTheApp(configurator, options) {
var url = 'http://localhost' + (options.port ? ':' + options.port : '');
return configurator
.plugin('opener-for-webpack', opener, [{url: url}]);
}
npm test
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.