-
-
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
reload browser when hash is changed but no modules was updated #3794
Comments
@xavierfoucrier but here some limitations, if you have |
Sure. In my case I will probably drop the |
@alexander-akait module.exports = {
//...
devServer: {
static: {
directory: path.join(__dirname, "dist"),,
// watch: true,
},
watchFiles: ["src/**/*"],
hot: false,
},
}; The above configuration works, but I still have a few questions:
|
As was described in migration guide, you should use |
static !== dist, webpack-dev-middleware handle webpack files, static is like |
watchFiles just watch files and reload browser when something was changed |
Okay.
This is a configuration inherited from v3. In the v3 version of the official website documentation example, the
So the previous setting of |
You can set |
@alexander-akait
Do I need to set |
Can you provide example of the problem? I think you should not disable |
@alexander-akait |
@alexander-akait PTAL🙏 |
@liby What is the problem, reload is working for you, hot will not because you don't have |
@alexander-akait The problem is that these descriptions. If I do not set
But obviously, I didn't explicitly turn on HMR in my configuration, there are no plugins installed. I also mentioned this problem at the beginning, as shown in the picture below. |
I can't reproduce, please provide all steps, reload is working with |
|
@liby Expected, what is wrong? |
|
I don't understand too, what is the problem, your example works as expected. Yes if you set |
I just want to ask about the default value of
For some reason, I only intend to enable live reload in the project at present, and I have no idea of enabling hot reload for the time being.
Thank you. Have a nice day. |
In your case just set |
This may be out of scope for wds, but it'd be great to have multi/SSR compilers have first class support for HMR, similar to Vite. Currently webpack-dev-server adds some additional entires for Instead it would be awesome if we could support a non web implementation of https://github.com/webpack/webpack-dev-server/blob/master/client-src/index.js that would connect to the websocket, emit changes to On top of this whenever the multi compiler is invalidated, you'd check to see if the file that was modified can be handled by the web compilers, and if so do an HMR there. If not then always reload the web compiler. The server compiler should always be able to HMR or exit. This is probably worth it's own issue and I'm happy to create one if so. |
@DylanPiercey make sense, do you want to send a PR? |
@alexander-akait Hi, I think this thread can be safely closed. The title of the problem has been resolved: if someone wants to have "live" reload, then just explicitly add the
|
@alexander-akait Thanks for the feedback!
I have completely removed the
staticOptions
and setup thedirectory
for my static files. I also removedwds
+src
watch content base (old) option. After that, all edited twig files triggers a new compilation, but still no browser reload. Withhot: false
, it works, weird 🤔Then I have set the
watchFiles
option to['src/**/*.twig']
withhot: true
: it works!Every file change trigger a compilation and browser reload.
Is that configuration looks fine to you or should I share my private repo with you for further check?
Thanks a lot mate 😉
Originally posted by @xavierfoucrier in #2758 (comment)
ref: webpack-contrib/copy-webpack-plugin#674
The text was updated successfully, but these errors were encountered: