html.js<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<scritp><%= compilation.assets[htmlWebpackPlugin.files.chunks.main.entry.substr(htmlWebpackPlugin.files.publicPath.length)].source() %></scritp>
</body>
</html>webpack.config.jsvar htmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
// 入口文件
entry: {
a: './a.js',
main: './main.js'
},
// 出口文件
output: {
filename: 'js/[name].js',
path: './dist'
},
// 插件安装
plugins: [
new htmlWebpackPlugin({
filename: 'a.html',
template: './index.html',
inject: 'body',
excludeChunks: ['main']
})
]
};问题:<scritp><%= compilation.assets[htmlWebpackPlugin.files.chunks.main.entry.substr(htmlWebpackPlugin.files.publicPath.length)].source() %></scritp>的方式加载的脚本是不是不能用excludeChunks排除掉?
添加回答
举报
0/150
提交
取消