let path = require('path')
module.exports = {
// context: 如果不通过path.resolve 配置入口访问路径 watch: true失效
context: path.resolve('./app'),
entry: {
index: './index.js',
mobile: './mobile.js'
},
output: {
// filename: 编译的文件名 仅用于命名每个文件
// [name]: 多入口形式 入口文件名替换这里的name
// [chunkhash]: 入口文件的hash值
filename: '[name].bundle.js',
// 包存放的目录
path: './lx',
// 非入口的文件名 某个文件不在入口文件 又需要打包时通过该入口起文件名打包
chunkFilename: '[id].bundle.js'
},
watch: true
}