gpt4 book ai didi

webpack init 尝试使用不受支持的 extract-text-webpack-plugin

转载 作者:行者123 更新时间:2023-12-02 18:22:09 24 4
gpt4 key购买 nike

当使用 ASP.NET Core 和 Webpack 创建新的 Web 项目时,我从 yarn 收到有关 extract-text-webpack-plugin 的依赖项警告。

<小时/>

我的重现步骤:

  1. dotnew 新网站
  2. yarn 初始化
  3. yarn add --dev webpack webpack-cli
  4. webpack 初始化

显示以下警告消息:

warning " > extract-text-webpack-plugin@3.0.2" has incorrect peer dependency "webpack@^3.1.0".

  • webpack
  • 显示以下错误消息:

    (node:19320) DeprecationWarning: Tapable.plugin is deprecated. Use new API on '.hooks' instead D:\SRC\MISC\WebpackTest\node_modules\webpack\lib\Chunk.js:460 throw new Error( ^

    Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead at Chunk.get (D:\SRC\MISC\WebpackTest\node_modules\webpack\lib\Chunk.js:460:9) at D:\SRC\MISC\WebpackTest\node_modules\extract-text-webpack-plugin\dist\index.js:176:48 at Array.forEach () at D:\SRC\MISC\WebpackTest\node_modules\extract-text-webpack-plugin\dist\index.js:171:18 at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\SRC\MISC\WebpackTest\node_modules\tapable\lib\HookCodeFactory.js:24:12), :7:1) at AsyncSeriesHook.lazyCompileHook [as _callAsync] (D:\SRC\MISC\WebpackTest\node_modules\tapable\lib\Hook.js:35:21) at Compilation.seal (D:\SRC\MISC\WebpackTest\node_modules\webpack\lib\Compilation.js:881:27) at hooks.make.callAsync.err (D:\SRC\MISC\WebpackTest\node_modules\webpack\lib\Compiler.js:464:17) at _err0 (eval at create (D:\SRC\MISC\WebpackTest\node_modules\tapable\lib\HookCodeFactory.js:24:12), :11:1) at _addModuleChain (D:\SRC\MISC\WebpackTest\node_modules\webpack\lib\Compilation.js:749:12) at processModuleDependencies.err (D:\SRC\MISC\WebpackTest\node_modules\webpack\lib\Compilation.js:688:9) at process._tickCallback (internal/process/next_tick.js:150:11)

    <小时/>

    当前正在下载的 webpack Yarn 版本是:

    "devDependencies": {
    "webpack": "^4.1.1",
    "webpack-cli": "^2.0.10"
    },

    我知道 extract-text-webpack-plugin 尚不支持 Webpack 4,所以我很好奇为什么 webpack init 尝试包含它。是否有 extract-text-webpack-plugin 的替代方案,或者是回滚到 Webpack 3 的唯一解决方法?

    最佳答案

    筹集后an issue使用 webpack-cli 这个错误的引用已在 pull request 中得到解决。 .

    该修复已将包依赖项更新为 extract-text-webpack-plugin@next,并且在本地进行了测试,我可以确认这不再在构建时引发错误。

    yarn remove extract-text-webpack-plugin
    yarn add --dev extract-text-webpack-plugin@next

    关于webpack init 尝试使用不受支持的 extract-text-webpack-plugin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49172495/

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