Webpack 2 的新语法
module:{
rules:[
{
test:/\.js$/,
loader:'babel-loader',
exclude:/node_modules/,
include:/src/
}
]
},
package.json中:
"babel":{
"presets":["env"]
},
module:{
rules:[
{
test:/\.js$/,
loader:'babel-loader',
exclude:/node_modules/,
include:/src/
}
]
},
package.json中:
"babel":{
"presets":["env"]
},
2017-06-05
由于版本问题,这里要这样写 module.exports = { entry:{ main:'./src/script/main.js', a:'./src/script/a.js' }, output:{ path: __dirname + '/dist/js', filename:'[name].js' //视频中的bundle要改成这样 } }
2017-06-05