Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
> webpack --config webpack-handle-css.js --progress --color
0% compiling(node:9447) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
77% module and chunk tree optimization unnamed compat plugin/Users/lx/workspace/front-web/node_modules/webpack/lib/Chunk.js:741
throw new Error(
^
Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
at Chunk.get (/Users/lx/workspace/front-web/node_modules/webpack/lib/Chunk.js:741:9)
at /Users/lx/workspace/front-web/node_modules/extract-text-webpack-plugin/dist/index.js:176:48
at Array.forEach (<anonymous>)
at /Users/lx/workspace/front-web/node_modules/extract-text-webpack-plugin/dist/index.js:171:18
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/lx/workspace/front-web/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:12:1)
at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/Users/lx/workspace/front-web/node_modules/tapable/lib/Hook.js:35:21)
at Compilation.seal (/Users/lx/workspace/front-web/node_modules/webpack/lib/Compilation.js:904:27)
at hooks.make.callAsync.err (/Users/lx/workspace/front-web/node_modules/webpack/lib/Compiler.js:494:17)
at _done (eval at create (/Users/lx/workspace/front-web/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:9:1)
at _err1 (eval at create (/Users/lx/workspace/front-web/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:32:22)
at _addModuleChain (/Users/lx/workspace/front-web/node_modules/webpack/lib/Compilation.js:770:12)
at processModuleDependencies.err (/Users/lx/workspace/front-web/node_modules/webpack/lib/Compilation.js:709:9)
at process._tickCallback (internal/process/next_tick.js:61:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mouth-platform-web-h5@1.0.0 css:build: `webpack --config webpack-handle-css.js --progress --color`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mouth-platform-web-h5@1.0.0 css:build 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! /Users/lx/.npm/_logs/2018-06-01T08_12_30_315Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mouth-platform-web-h5@1.0.0 css: `npm run css:build && npm run css:clean`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mouth-platform-web-h5@1.0.0 css 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! /Users/lx/.npm/_logs/2018-06-01T08_12_30_357Z-debug.log
分析问题
Yep extract-text-webpack-plugin isn't updated for webpack >= v4.0.0 yet and is completely broken since webpack@4.0.0-alpha.5. It may be superseded by another plugin/solution or will get an update before the final webpack v4.0.0 release
出现这个问题了,那基本上你用的webpack版本一定是4.0.0以上的了。
解决方法
npm install --save-dev extract-text-webpack-plugin@next
lxdeMacBook-Air:front-web lx$ npm install --save-dev extract-text-webpack-plugin@next
npm WARN react-native-collapsible@0.9.0 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-drawer-layout@1.3.2 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-redux@5.0.7 requires a peer of redux@^2.0.0 || ^3.0.0 || ^4.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN uglifyjs-webpack-plugin@1.1.6 requires a peer of webpack@^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-middleware@1.12.0 requires a peer of webpack@^1.0.0 || ^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN mouth-platform-web-h5@1.0.0 No repository field.
+ extract-text-webpack-plugin@4.0.0-beta.0
removed 3 packages and updated 1 package in 11.617s
已经下载到 + extract-text-webpack-plugin@4.0.0-beta.0
然后在打包就正常了