webpack使用extract-text-webpack-plugin打包时提示错误

webpack使用extract-text-webpack-plugin打包时提示错误Use Chunks.groupsIterable and filter by instanceof Entryp

异常

 

Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead

 

> demo@1.0.0 dev D:\Development\web\webpack-study\demo
> webpack-dev-server --host 127.0.0.1 --port 8888 --open --config webpack.config.js

(node:38236) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
i 「wds」: Project is running at http://127.0.0.1:8888/
i 「wds」: webpack output is served from /dist/
i 「wdm」: wait until bundle finished: /dist/main.css
i 「wdm」: wait until bundle finished: /dist/main.js
D:\Development\web\webpack-study\demo\node_modules\webpack\lib\Chunk.js:824
                throw new Error(
                ^

Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
    at Chunk.get (D:\Development\web\webpack-study\demo\node_modules\webpack\lib\Chunk.js:824:9)
    at D:\Development\web\webpack-study\demo\node_modules\extract-text-webpack-plugin\dist\index.js:176:48
    at Array.forEach (<anonymous>)
    at D:\Development\web\webpack-study\demo\node_modules\extract-text-webpack-plugin\dist\index.js:171:18
    at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\Development\web\webpack-study\demo\node_modules\tapable\lib\HookCodeFactory.js:24:12), <anonymous>:7
:1)
    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (D:\Development\web\webpack-study\demo\node_modules\tapable\lib\Hook.js:35:21)
    at Compilation.seal (D:\Development\web\webpack-study\demo\node_modules\webpack\lib\Compilation.js:1203:27)
    at hooks.make.callAsync.err (D:\Development\web\webpack-study\demo\node_modules\webpack\lib\Compiler.js:547:17)
    at _err0 (eval at create (D:\Development\web\webpack-study\demo\node_modules\tapable\lib\HookCodeFactory.js:24:12), <anonymous>:11:1)
    at _addModuleChain (D:\Development\web\webpack-study\demo\node_modules\webpack\lib\Compilation.js:1054:12)
    at processModuleDependencies.err (D:\Development\web\webpack-study\demo\node_modules\webpack\lib\Compilation.js:980:9)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! demo@1.0.0 dev: `webpack-dev-server --host 127.0.0.1 --port 8888 --open --config webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the demo@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\shangwu\AppData\Roaming\npm-cache\_logs\2018-07-24T09_41_17_948Z-debug.log

D:\Development\web\webpack-study\demo>

 

问题分析

看官网也有这个问题,extract-text-webpack-plugin还不能支持webpack4.0.0以上的版本。有个这样的描述 

既然出现这个问题了,那基本上你用的webpack版本一定是4.0.0以上的了。 
查看下package.json里

处理方法

npm install --save-dev extract-text-webpack-plugin@next 

 

这样就解决了

 

 

 

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值