为什么在webpack.config.js里plugin的里面,chunks这个会报错
为什么在webpack.config.js里plugin的里面,chunks这个会报错
为什么在webpack.config.js里plugin的里面,chunks这个会报错
2017-02-21
代码:var htmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry:{
main: './src/script/main.js',
a: './src/script/a.js',
b: './src/script/b.js',
c: './src/script/c.js'
},//打包的入口 /*['./src/script/main.js','./src/script/a.js'],*/
output: {
path: './dist',// 路径
filename: 'js/[name]-[chunkhash].js',//打包以后的文件名 [name]-[chunkhash] [name]-[hash]
publicPath: 'https:abc.com'
},
plugins:[
new htmlWebpackPlugin({
filename: 'a.html',
template: 'index.html',
inject: 'body',
title: 'this is a.html',
chunks: ['a','main']
}),
new htmlWebpackPlugin({
filename: 'b.html',
template: 'index.html',
inject: 'body',
title: 'this is b.html',
chunks: ['b']
}),
new htmlWebpackPlugin({
filename: 'c.html',
template: 'index.html',
inject: 'body',
title: 'this is c.html',
chunks: ['c']
})
]
}
错误:
举报