vue 使用webpack 打包 出现UnhandledPromiseRejectionWarning: Error: "dependency" is not a valid chunk sort ...

  具体错误如下

building for production...(node:12444) UnhandledPromiseRejectionWarning: Error: "dependency" is not a valid chunk sort mode
    at HtmlWebpackPlugin.sortEntryChunks (D:\Desktop\enn\venue\node_modules\html-webpack-plugin\index.js:488:11)
    at compiler.hooks.emit.tapAsync (D:\Desktop\enn\venue\node_modules\html-webpack-plugin\index.js:178:39)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\Desktop\enn\venue\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymou
s>:7:1)
    at AsyncSeriesHook.lazyCompileHook (D:\Desktop\enn\venue\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)
    at Compiler.emitAssets (D:\Desktop\enn\venue\node_modules\webpack\lib\Compiler.js:363:19)
    at onCompiled (D:\Desktop\enn\venue\node_modules\webpack\lib\Compiler.js:231:9)
    at hooks.afterCompile.callAsync.err (D:\Desktop\enn\venue\node_modules\webpack\lib\Compiler.js:552:14)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\Desktop\enn\venue\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymou
s>:6:1)
    at AsyncSeriesHook.lazyCompileHook (D:\Desktop\enn\venue\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)
    at compilation.seal.err (D:\Desktop\enn\venue\node_modules\webpack\lib\Compiler.js:549:30)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\Desktop\enn\venue\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymou
s>:6:1)
    at AsyncSeriesHook.lazyCompileHook (D:\Desktop\enn\venue\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)
    at hooks.optimizeAssets.callAsync.err (D:\Desktop\enn\venue\node_modules\webpack\lib\Compilation.js:1323:35)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\Desktop\enn\venue\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymou
s>:6:1)
    at AsyncSeriesHook.lazyCompileHook (D:\Desktop\enn\venue\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)
    at hooks.optimizeChunkAssets.callAsync.err (D:\Desktop\enn\venue\node_modules\webpack\lib\Compilation.js:1314:32)
(node:12444) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch bl
ock, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:12444) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the N
ode.js process with a non-zero exit code.

 

这个选项决定了 script 标签的引用顺序。默认有四个选项,'none', 'auto', 'dependency', '{function}'。

  • 'dependency'  按照不同文件的依赖关系来排序。

  • 'auto' 默认值

  • 'none'  

  • {function}  不懂

       'dependency'  按照不同文件的依赖关系来排序  

 改为auto  注销都可以

 

 

npm run build 

打包成功

 

转载于:https://www.cnblogs.com/thymeleaf/p/10248708.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值