7

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

1 Answer 1

-2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

That's not answering his question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.