webpack+Vue引入iView找不到字型檔案
原因:
- css-loader後面帶了引數modules(打包報錯)
- url-loader後面帶了引數name(引入報錯)
{
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]"
}
解決方案:去掉引數
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader!postcss-loader"
})
},
{
test: /\.(svg|ttf|eot|woff)\??.*$/,
loader: "url-loader?limit=10000"
}
或者
{
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"
}