在vendors里面配置filename报错
来源:4-5 SplitChunksPlugin 配置参数详解(1)
强哥别在卷了
2020-03-05
老师我在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)模式下才有效,如下图
2.name:Providing a string or function will allow you to use a custom name(在async或者all模式下使用可自定义文件名),效果图如下:
112020-03-07
相似问题