-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Html hot update #1480
Comments
Unfortunately that’s not possible because we don’t know which changes to the html are caused by javascript... But I am open to ideas to solve this |
Sorry, When I update it, it doesnt reload the page. |
Reloading should be possible however we would need help from the webpack core team to use the webpack-dev-server socket connection |
@vin-ni To "solve" this issue, I developed webpack-add-dependency-plugin. It allows you to make webpack aware of these kind of template files that are indirect dependencies to it and I've used it myself to solve a similar use case. |
Wow @bebraw that's cool - do you think we should use it directly with the html webpack plugin? e.g. apply(compiler) {
const webpackAddDependencyPlugin = new WebpackAddDependencyPlugin({ path: this.options.template });
webpackAddDependencyPlugin.apply(compiler); Will it trigger a reload? Webpack already tracks all files from the html-webpack-plugin as dependencies. |
It’s worth a go. Check the internals of the plugin, it’s not doing much.
… On 22. Jul 2020, at 18.17, Jan Nicklas ***@***.***> wrote:
Wow @bebraw that's cool - do you think we should use it directly with the html webpack plugin?
e.g.
apply(compiler) {
const webpackAddDependencyPlugin = new WebpackAddDependencyPlugin({ path: this.options.template });
webpackAddDependencyPlugin.apply(compiler);
Will it trigger a reload?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@jantimon Did you find a solution for this in webpack 5? |
I checked the webpack-add-dependency-plugin but unfortunately it won’t help here as all files are already added by the html-webpack-plugin An auto reload feature would need to be exposed by the webpack-dev-server however there is none :( |
Ok, I see.
Can you open an issue at webpack-plugin-serve describing what you would need? I am not sure if we can do it there but it's worth discussing at least. |
Not sure if it helps anyone, but I got reloading working with webpack 5 by adding |
With webpack 5,this setting is work for me: devServer: {
hot:true,
open:true,
watchFiles: ['src/**/*']
}, |
Hello,
is it possible to get the html updated on save?
Thanks!
The text was updated successfully, but these errors were encountered: