在用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'])]}
ABOUTYOU
相关分类