简体   繁体   中英

Webpack DevServer do not reload page

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM