在最小的2.6.1版本中要这样,才不会报错
module.exports = {
//入口文件
entry : {
main: "./src/script/main.js",
a: "./src/script/a.js"
},
//指定打包后的文件存放位置
output: {
//路径+文件名
filename: './dist/js/[Hash]-[name].js'
}
}
module.exports = {
//入口文件
entry : {
main: "./src/script/main.js",
a: "./src/script/a.js"
},
//指定打包后的文件存放位置
output: {
//路径+文件名
filename: './dist/js/[Hash]-[name].js'
}
}
2017-06-09
var htmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
module.exports = {
output: {
filename: '[name]-[hash].js',
path: path.resolve(__dirname,'dist/js')
},
plugins: [
new htmlWebpackPlugin({
template: 'index.html' })]
var path = require('path');
module.exports = {
output: {
filename: '[name]-[hash].js',
path: path.resolve(__dirname,'dist/js')
},
plugins: [
new htmlWebpackPlugin({
template: 'index.html' })]
2017-06-06