webpack.config.js
var path = require('path'); module.exports = { entry: "./es6/demo01.js",//入口文件 output: {//打包输出的文件 path: __dirname, filename: "bundle.js" }, watch: true, module: { loaders: [ { test: path.join(__dirname, 'es6'), loader: 'babel-loader', query: { presets: ['es2015'] } } ] } };