sagold / handlebars-webpack-plugin

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

DeprecationWarning: Compilation.assets in webpack v5 #78

Open sw1tchdev opened 3 years ago

sw1tchdev commented 3 years ago

Hello, thanks for plugin. When i tried to using handlebars-webpack-plugin with webpack v5, bundler shows a deprecation warning:

[DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
        Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
        Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.
wakenby commented 3 years ago

Hello, is an update planned? I really want hbs to be alive in wabpack

sagold commented 3 years ago

Hi all,

i will attend to the deprecation warning as soon as there is some spare time. Any pull requests for this topic are also appreciated.

Regards, sagold

xavierfoucrier commented 3 years ago

Same on my side. Not really an issue, just a deprecation warning. Subscribing to this thread and wait to see the pull request merged with master branch :wink:

xavierfoucrier commented 3 years ago

Hi @sagold, Any news about the PR to fix this issue with webpack@5?

Thanks :sunglasses:

sagold commented 3 years ago

the fix on dev should be working. But the changes made in html-webpack-plugin probably wont support an integration any longer. This is open for investigation. We might need to drop support for other plugins. This doesnt scale anyway...

xavierfoucrier commented 3 years ago

@sagold yes, you might need to upgrade all the stack of dev dependencies.

SassNinja commented 3 years ago

I'm facing the same deprecation warning, after having migrated a project (which uses this handlebars plugin) to webpack 5.

@sagold what do you mean with "the fix on dev should be working"?

I think the reason for the warning is that you're modifying compilation.assets directly what's not recommended anymore. That code still exists in the develop branch https://github.com/sagold/handlebars-webpack-plugin/blob/develop/index.js#L348

xavierfoucrier commented 2 years ago

Hello @sagold,

Any feedback on this?

xavierfoucrier commented 1 year ago

Hello @sagold,

Any news about updating this plugin? Still in use by many people...

I am thinking about making a fork, or helping you merging existing PRs + fix issues.

Thanks for your feedback! :+1:

sagold commented 1 year ago

Hi Xavier.

Thank you for the offer! We should add some maintainers to this repository as this obviously is not my priority.

I plan to update the plugin within the next weeks (and dropping html-webpack-plugin support).

Care to align?

Cheers, sagold

xavierfoucrier commented 1 year ago

Hi @sagold!

Yeah I can understand about priorities, this past few months open source was not mine too, we all have a side "real" job behind this open source life :smile: ...

Feel free to send me an invite, I can definitely help on this one as I am using it all days!

webdiscus commented 1 year ago

Hi @xavierfoucrier,

you can try to use the new html-bundler-webpack-plugin. This plugin support the Handlebars templates and has many cool features: