Closed jeromehan closed 1 month ago
I can help to support this
While this is needed for a few plugins to work, the optimizeAssets
hook is deprecated and to be removed in Webpack 6 @hardfist
In webpack 5, optimizeAssets
is just a shim over the processAssets
hook. should i do the same in Rspack as well?
@burhanuday thank you for this helpful information, I think we can hold on the optimizeAssets implementation until we really need,@jeromehan can you help file a issue | PR in @unocss/webpack@0.58.0 and see whether they're willing to replace it with processAssets implementation
@burhanuday https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/Compilation.js#L817 it seems webpack only deprecate it in source code comment, the users are not aware this hook is deprecated, maybe we should give deprecate warning to plugin author in webpack, and BTW is there any documentation or issue tracking the deprecate the plan of webpack 6(what will be deprecated or removed in webpack 6)
According to the description of the PR https://github.com/webpack/webpack/pull/10876, it should emit a deprecation warning in the console. Not aware of any issue where this is tracked. Pulling in @alexander-akait to see if he is aware I'll raise a PR to update the docs since it is missed there
@hardfist Yeah, you are right, but we are avouding deprecation messages because it was implemented/refactored in the minor version and adding the deprecation message will make mess in console, but for webpack 6 we will add soft deprecation (still a lot of plugins use it, but we will check it before), so I think better do not implement optimizeAssets
for rspack
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
bump
@unocss/webpack will use processAssets hooks in the next version. Stay tuned for updates.
and you also need to create an empty file named __uno.css
for the plugin to work with rspack.
hi there, I used to use postcss to support unocss, but recently I want to switch to @unocss/webpack. Do you solve it?
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
@unocss/webpack will use processAssets hooks in the next version. Stay tuned for updates.
and you also need to create an empty file named
__uno.css
for the plugin to work with rspack.
这样当npm run dev的时候就生成一次css,此后再修改className就不会再生成了
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
close this issue since we don't plan to support hooks.optimizeAssets hooks
System Info
null
Details
@unocss/webpack@0.58.0
need compilation.hooks.optimizeAssets API
Reproduce link
No response
Reproduce Steps