1

I am using webpack devServer. Every time I change my source files the files get built and the page served by devServer gets reloaded. I do not want devServer to reload the page. I want the devServer to only build and serve files while I reload the page manually.

Here is my webpack configuration for DevServer.

devServer: {
    contentBase: './dist',
    port: 8002,
    watchContentBase: false,
  },

I tried setting hot: false and hotOnly: false but the devServer still builds and reloads the webpage every time the source file changes.

1 Answer 1

3

There is two options: devServer.injectClient and devServer.injectHot. Try to set it to false. No WDS client on a board - no problem. Depends on CLI, check that no HotModuleReplacementPlugin attached.

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

1 Comment

Thanks a lot. It worked. I was expecting an option such as reloadOnBuild or something like that in the dev server configuration. Anyway I found out that to stop reloading only setting injectClient to false is sufficient.

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.