webpack.base.config 文件中
修改前:
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
use: [‘css-loader?minimize‘, ‘autoprefixer-loader‘],
fallback: ‘style-loader‘
})
},
{
test: /\.less$/,
use: ExtractTextPlugin.extract({
use: [‘css-loader?minimize‘,‘autoprefixer-loader‘, ‘less-loader‘],
fallback: ‘style-loader‘
}),
},
修改后:
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
use: [‘css-loader?minimize‘, ‘autoprefixer-loader‘],
publicPath:‘./‘,
fallback: ‘style-loader‘
})
},
{
test: /\.less$/,
use: ExtractTextPlugin.extract({
use: [‘css-loader?minimize‘,‘autoprefixer-loader‘, ‘less-loader‘],
publicPath:‘./‘,
fallback: ‘style-loader‘
}),
},
就是增加了publicPath:‘./‘,(可能还是找不到,具体F12看报错,然后进行调整或改为 publicPath:‘../../‘或改为publicPath:‘../dist/‘, 看个人的配置 )
原文地址:https://www.cnblogs.com/me168/p/10424955.html