看下之前的项目,发现有添加stage-2
npm install --save--dev babel-preset-stage-2
var webpack = require('webpack')
var path = require('path')
module.exports = {
entry: './js/index.js',
output: {
path: __dirname,
filename: 'bundle.js'
},
module: {
loaders: [
{
test: path.join(__dirname, './js'),
loader: 'babel-loader',
query: {
presets: ['es2015', 'stage-2']
}
}
]
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…