gpt4 book ai didi

reactjs - 弃用警告: Compilation. Assets 将来会被卡住,所有修改均已弃用

转载 作者:行者123 更新时间:2023-12-03 16:42:52 26 4
gpt4 key购买 nike

我正在做一个 react 项目,当我将webpack 4.44.2更新到5.4.0时,我收到以下消息:

[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_*.
(Use `node --trace-deprecation ...` to show where the warning was created)
我进行了很多搜索,但未获得确切答案。那我该如何解决呢?

最佳答案

更新2021年2月25日
HTML-Webpack-plugin v5已发布,只需运行

npm i -D html-webpack-plugin@latest
或者
npm uninstall html-webpack-plugin

npm i -D html-webpack-plugin

原始答案
这主要与html-webpack-plugin有关,尽管其新版本5(与webpack v5集成)仍处于beta中,但您应该手动更新它:
npm show html-webpack-plugin version 
4.5.1

npm show html-webpack-plugin@next version
5.0.0-beta.5

npm i -D html-webpack-plugin@next

关于reactjs - 弃用警告: Compilation. Assets 将来会被卡住,所有修改均已弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64816231/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com