1.vue打包404
config中index.js文件的build中的assetsPublicPath: '/',改为assetsPublicPath: './',
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: './',
//打包后正常运行
}
2.引入ElementUI打包后小图标不显示
build中until.js文件中if (options.extract)判断下加入publicPath:'../../'
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader',
publicPath:'../../',
// 打包后elementui显示图标
})
} else {
return ['vue-style-loader'].concat(loaders)
}
总结:都是路径问题。