webpack.config.js中不同页面引入不同chunks却没有在html中引入相应的js脚本
a,b,c三个html分别引入的chunks如下:chunks: ['main','a'] chunks: ['main','b'] chunks: ['c'],a中引入了main.js和a.js,b中引入了main.js,而c中却没有引入任何js脚本 ,求解?
a,b,c三个html分别引入的chunks如下:chunks: ['main','a'] chunks: ['main','b'] chunks: ['c'],a中引入了main.js和a.js,b中引入了main.js,而c中却没有引入任何js脚本 ,求解?
2017-06-06
plugins: [
/*new webpack.ResolverPlugin([
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"])
], ["normal", "loader"])*/
new htmlWebpackPlugin({
template:'index.html',
filename:'a.html',
inject:'body',
title:'a.html',
chunks:['main','a']
}),
new htmlWebpackPlugin({
template:'index.html',
filename:'b.html',
inject:'body',
title:'b.html',
chunks:['b']
}),new htmlWebpackPlugin({
template:'index.html',
filename:'c.html',
inject:'body',
title:'c.html',
chunks:['c']
})
构建后只有b.html和c.html没有任何监本引入
举报