sagold / handlebars-webpack-plugin

Renders your html-template at build time
161 stars 45 forks source link

Editing helper code doesn't make any change in output until restart #72

Closed 5ulo closed 3 years ago

5ulo commented 3 years ago

After saving changes in helper file the webpack-dev-server compiles and reloads as usually, but the changes aren't visible until I manually stop webpack-dev-server and run it again. It's a bit uncomfortable while writing custom helper from scratch.

Is there any option that watches any helper change? Helper editing and reloading is working with handlebars-loader which I don't want to use. note: reload on hbs files works perfectly. Thanks

module.exports = (env, argv) => {
    return {
        plugins: [
            new HandlebarsPlugin({
                helpers: {
                    projectHelpers: path.join(dirHelpers, "*.js")
                },
            }),
        ]
    }
};
sagold commented 3 years ago

Which operating system are you using?

5ulo commented 3 years ago

MacOs

sagold commented 3 years ago

I can confirm this and will look into it. The change is recognized, but the new result is not emitted.

sagold commented 3 years ago

A fix is published with v2.1.1. Does this work for you?

5ulo commented 3 years ago

@sagold Yes, v2.1.1 fixed this issue. Perfect job!

5ulo commented 3 years ago

So.. this is weird, I haven't noticed it before.. website reloads on partial, layout, helper change, but does not reload on page change. Change is recognised, I see it in the console.