造成这个错误主要有3个可能的原因:
dll.config.js
module.exports = { mode:"production",output: { path:path.resolve(__dirname,'../dist'),filename: '[name].dll.js',library: dllName,//这里需要和DllPlugin option.name 一致 },entry: { "lib": vendors,},plugins: [ new webpack.DllPlugin({ path:path.resolve(__dirname,'../dist/manifest.json'),name: dllName,context: __dirname,//上下文必填 }),new CleanWebpackPlugin([`./dist/*.dll.js`,`./dist/*.json`],{ root: path.resolve(__dirname,"../") }),] } @H_502_13@webpack.config.js
new webpack.DllReferencePlugin({ context: __dirname,//这个上下文对应DllPlugin manifest: require('../dist/manifest.json')} ),new AddAssetHtmlPlugin( [ { filepath: "./dist/*.dll.js",//将生成的dll文件加入到index.html中 },] ),@H_502_13@ 原文链接:https://www.f2er.com/js/534791.html