原因:
css-loader后面带了参数modules(打包报错)
url-loader后面带了参数name(引入报错)
1 2 3 4 5 6 7 8 9 10 11 | { test: /\.css$/, use: ExtractTextPlugin.extract({ fallback: "style-loader" , use: "css-loader?modules!postcss-loader" }) }, { test: /\.(svg|ttf|eot|woff)\??.*$/, loader: "url-loader?limit=10000&name=fonts/[name].[ext]" } |
解决方案:去掉参数
1 2 3 4 5 6 7 8 9 10 11 | { test: /\.css$/, use: ExtractTextPlugin.extract({ fallback: "style-loader" , use: "css-loader!postcss-loader" }) }, { test: /\.(svg|ttf|eot|woff)\??.*$/, loader: "url-loader?limit=10000" } |
或者
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | { test: /\.css$/, exclude: /node_modules/, use: ExtractTextPlugin.extract({ fallback: "style-loader" , use: "css-loader?modules!postcss-loader" }) }, { test: /\.css$/, include: /node_modules/, use: ExtractTextPlugin.extract({ fallback: "style-loader" , use: "css-loader!postcss-loader" }) }, { test: /\.(svg|ttf|eot|woff)\??.*$/, loader: "url-loader?limit=10000" } |
解决webpack+Vue引入iView找不到字体文件的问题
原文地址:https://www.cnblogs.com/aillabig/p/9786038.html