html-webpack-plugin插件该如何修改favicon的输出路径?

在用webpack的时候,想要使用html-webpack-plugin来注入favicon,但是输出路径是output.path的,不知道怎么改
代码
constwebpack=require('webpack');
constpath=require('path');
consthtmlWebpackPlugin=require('html-webpack-plugin');
constcleanWebpackPlugin=require('clean-webpack-plugin');
module.exports={
entry:'app/scripts/main.js',
output:{
filename:'bundle.js',
path:'dist/scripts'
},
module:{
rules:[
{
test:/\.js$/,
exclude:/(node_modules|bower_components)/,
use:{
loader:'babel-loader',
options:{
presets:['react','es2015']
}
}
}
]
},
plugins:[
newwebpack.optimize.UglifyJsPlugin(),
newhtmlWebpackPlugin({
favicon:'app/favicon.ico',
filename:"dist/index.html",
template:'app/index.html'
}),
newcleanWebpackPlugin(['dist'])
]
}
哔哔one
浏览 2282回答 2
2回答

ABOUTYOU

陷入逻辑陷阱了,只想改html-webpack-plugin中的配置,其实可以把output改一下output:{path:'dist',filename:'scripts/bundle.js'}
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript