Я настроил веб-пакет для моего веб-расширения.В package.json
я определил следующий сценарий:
"scripts": {
"start": "webpack --config webpack.config.js"
},
, поэтому веб-пакет можно запустить с помощью одного из следующих двух параметров:
- npm run start
- webpack --config webpack.config.js
Но, хотя npm run start
работает нормально, прямой вызов webpack --config webpack.config.js
завершается неудачно.Вот мой код: https://github.com/lhk/webextensions-webpack-boilerplate
Вы можете воспроизвести проблему с помощью следующих шагов:
git clone https://github.com/lhk/webextensions-webpack-boilerplate
cd webextensions-webpack-boilerplate
npm install
tsc -p tsconfig.json
webpack --config webpack.config.js
Сообщение об ошибке:
clean-webpack-plugin: /home/lhk/.local/share/Trash/files/temp.2/webextensions-webpack-boilerplate/dist has been removed.
(node:21823) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
/usr/lib/node_modules/webpack/lib/Chunk.js:827
throw new Error(
^
Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
at Chunk.get (/usr/lib/node_modules/webpack/lib/Chunk.js:827:9)
at /home/lhk/.local/share/Trash/files/temp.2/webextensions-webpack-boilerplate/node_modules/extract-text-webpack-plugin/dist/index.js:176:48
at Array.forEach (<anonymous>)
at /home/lhk/.local/share/Trash/files/temp.2/webextensions-webpack-boilerplate/node_modules/extract-text-webpack-plugin/dist/index.js:171:18
at AsyncSeriesHook.eval [as callAsync] (eval at create (/usr/lib/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:7:1)
at AsyncSeriesHook.lazyCompileHook (/usr/lib/node_modules/webpack/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.seal (/usr/lib/node_modules/webpack/lib/Compilation.js:1215:27)
at hooks.make.callAsync.err (/usr/lib/node_modules/webpack/lib/Compiler.js:541:17)
at _err0 (eval at create (/usr/lib/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:11:1)
at _addModuleChain (/usr/lib/node_modules/webpack/lib/Compilation.js:1066:12)
at processModuleDependencies.err (/usr/lib/node_modules/webpack/lib/Compilation.js:982:9)
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickCallback (internal/process/next_tick.js:181:9)
Информация о системе:
- версия узла: v8.12.0
- npm версия: 6.4.1
- операционная система: Ubuntu 18.04 (64bit)