为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

哔哔one 2019-05-23 18:50:30
在用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'])]}
查看完整描述

2 回答

?
ABOUTYOU

TA贡献1812条经验 获得超5个赞

陷入逻辑陷阱了,只想改html-webpack-plugin中的配置,其实可以把output改一下
output:{
path:'dist',
filename:'scripts/bundle.js'
}
                            
查看完整回答
反对 回复 2019-05-23
  • 2 回答
  • 0 关注
  • 2307 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号