1.使用vue-cli脚手架
在vue.config.js里配置
pages: {
index: {
entry: 'src/index.js',
template: 'src/index.html',
filename: 'index.html',
favicon:'./public/favicon.ico'
},
},
2.使用webpack
在webpack.config.js里配置
module.exports = {
...
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true,
favicon:'./public/favicon.ico'
}),
}