最近使用vue 框架做项目,遇到的问题在此记录,仅供参考
1.ico 添加
###1.1 build/webpack.dev.conf.js
devWebpackConfig.plugins 添加:
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
favicon:'src/assets/logo.ico',//关键语句
inject: true
}),
###1.2 build/webpack.prod.conf.js
webpackConfig.plugins 添加
new HtmlWebpackPlugin({
filename: process.env.NODE_ENV === 'testing'
? 'index.html'
: config.build.index,
template: 'index.html',
inject: true,
favicon:'src/assets/logo_zj.ico', //关键部分
...
})