I want to build multiple HTML files, each with a separate entry point. Seems like webpack-dev-server is only serving a single HTML file.
1 Answer
You can take advantage of npm script and have to separate configs.
package.json:
"scripts": {
"build-first-app": "webpack-dev-server --env=first",
"build-second-app": "webpack-dev-server --env=second"
}
webback.config.js:
module.exports = function(env) {
return require(`./webpack.config.${env}.js`)
};
Now you need to separate files(webpack.config.first.js and webpack.config.second.js) each with there own webpack configuration. Run the command npm run build-first-app to display the first app and npm run build-second-app for the second.
1 Comment
alexunder
That's not answering his question.