请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

在vendors里面配置filename报错

老师我在vendors下如果配置了filename的话打包会报错:(node:2596) UnhandledPromiseRejectionWarning: Error: SplitChunksPlugin: You are trying to set a filename for a chunk which is (also)
loaded on demand. The runtime can only handle loading of chunks which match the chunkFilename schema. Using a custom filename would fail at runtime. (cache group: vendors)
如果去了filename的话就好!图片描述

正在回答

1回答

    仔细阅读文档:https://webpack.docschina.org/plugins/split-chunks-plugin/

    1.filename:Allows to override the filename when and only when it's an initial chunk(filename只有在模式为initial)模式下才有效,如下图

https://img1.sycdn.imooc.com//szimg/5e63c0f4091309c519201040.jpg

    2.name:Providing a string or function will allow you to use a custom name(在async或者all模式下使用可自定义文件名),效果图如下:

https://img1.sycdn.imooc.com/szimg/5e63c19e091cb7bb19201042.jpg

1 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信