-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nothing seems to disable file watching / hot reloading #1744
Comments
It is impossible, don't use |
Why do you want disable |
Then why do you have all the watch options? https://webpack.js.org/configuration/watch/ Why do you also allow hot reloading to be turned off in the config? This doesn't seem like a satisfactory answer. |
We run the dev server as part of our CI. We run Selenium tests against the dev server as part of each commit that's going through review and we also run Selenium tests daily. We like the dev server because in dev mode, there is extra output to the browser console, like React PropTypes errors and other things of that nature. However, in a CI environment, there clearly won't be any changes to the source files, so we'd like to disable file watching. We've found that the webpack dev server sometimes has a mind of its own and rebuilds when it doesn't need to, like if a file is simply read or touched. Rebuilding causes the UI to refresh, which causes tests to fail. |
Read documentation - it is for |
I think using |
Okay, that's what I was afraid of. Thanks, I'll look into that. |
Something wrong in you CI setup, webpack doesn't do rebuild if it is unnecessary |
If you provide link/minimum reproducible test repo i can look what is wrong. |
I've found that running Jest (locally) while running the webpack dev server causes the server to rebuild over and over, even though none of the source files are changing. |
@kaiyoma can you create minimum reproducible test repo? |
I can try. I'll let you know if I can. |
@evilebottnawi Is there a way to disable the auto-refresh behavior? I would like webpack-dev-server to rebuild on every file change, but I don't want the page in the browser to refresh until I do it myself. I've tried searching all over but I can't figure out how to do this. |
@kaiyoma What do you mean? I can't understand what you want? Just use |
I would like a way to have a server that serves the files, and I would like the bundle to be rebuilt automatically when a source file is modified, but I don't want the browser to automatically reload the page. I don't think It seems that other people want this too: #1276 It would be nice if there was a way to disable both HMR and automatic page refreshing. Our UI is very expensive to load, so that's why I don't want the page to automatically refresh on every change. |
hm, sound reasonable, let's reopen and mark as feature because it is rare use case will be better if you take care about this and send a PR |
Great, thanks! It sounds like there's already a PR in the works, so I'll wait for that. |
Looks PR was abandoned, so feel free to send new PR |
fixed via #1889. |
Operating System: Windows 10
Node Version: 10.15.0
NPM Version: 6.4.1
webpack Version: 4.29.6
webpack-dev-server Version: 3.2.1
How do you disable file watching / hot reloading? I've been banging my head against the wall for a while now, reading various SO threads and GitHub issues, and yet nothing seems to work.
I've tried the following:
hot: false
inline: false
HotModuleReplacementPlugin
from my list of pluginspublicPath
(which actually breaks the UI entirely)watch: false
And yet, every time I save a change to a source file, the dev server rebuilds, messages are sent to the browser console, and (optionally) the page is refreshed.
I really don't understand the last one (
watch: false
) since it seems like exactly the option I'm looking for, yet it doesn't seem to have any effect. Has anyone actually been able to disable file watching?The text was updated successfully, but these errors were encountered: