在用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'])]}
html-webpack-plugin插件該如何修改favicon的輸出路徑?
嗶嗶one
2019-05-23 18:50:30