在用webpack的时候,想要使用html-webpack-plugin来注入favicon,但是输出路径是output.path的,不知道怎么改
代码
const webpack = require('webpack');
const path = require('path');
const htmlWebpackPlugin = require('html-webpack-plugin');
const cleanWebpackPlugin = 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: [
new webpack.optimize.UglifyJsPlugin(),
new htmlWebpackPlugin({
favicon:'app/favicon.ico',
filename:"dist/index.html",
template: 'app/index.html'
}),
new cleanWebpackPlugin(['dist'])
]
}