如题所示,如果webpack这样配置
var htmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
let pathsToClean = [
'dist',
];
module.exports = {
entry: './src/app.js',
output: {
path: __dirname + '/dist',
filename: 'main.[chunkhash].js',
},
plugins: [
new htmlWebpackPlugin({
template: './src/footer.html',
hash: true,
filename: "footer.html",
minify: {
collapseWhitespace: false
}
}),
new CleanWebpackPlugin(pathsToClean),
],
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
]
}
};
那么最后html引入文件是这样的:
我希望最后自动生成的这个html文件,引入的地址是/static/js/js文件 这样的格式,怎么做?