码迷,mamicode.com
首页 > Web开发 > 详细

解决webpack+Vue引入iView找不到字体文件的问题

时间:2018-10-14 16:27:36      阅读:593      评论:0      收藏:0      [点我收藏+]

标签:打包   syntax   lsp   view   containe   too   net   plain   cin   

原因:

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找不到字体文件的问题

标签:打包   syntax   lsp   view   containe   too   net   plain   cin   

原文地址:https://www.cnblogs.com/aillabig/p/9786038.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!