我正在使用这些模块
"devDependencies": {
"@babel/core": "^7.0.0-beta.46",
"@babel/preset-env": "^7.0.0-beta.46",
"chai": "^4.1.2",
"chai-http": "^4.0.0",
"grunt": "^1.0.2",
"grunt-babel": "^8.0.0-beta.0",
"grunt-cli": "^1.2.0",
"mocha": "^5.1.1"
}
我的咕噜声文件
// Configure
grunt.initConfig({
babel: {
options: {
presets: ['@babel/preset-env']
},
dist: {
files: {
'lib/helper.js': 'src/helper.js',
'lib/servekaro.js': 'src/servekaro.js'
}
}
}
})
// Load babel tasks
grunt.loadNpmTasks('grunt-babel')
// Default
grunt.registerTask('default', ['babel'])
这是我得到的错误
Warning: src/helper.js: Unexpected token, expected ";" (46:38)
44 | .filter(([key, value]) => keys.includes(key))
45 | // Map arrays to object entry
> 46 | .map(([key, value]) => { [key]: val })
| ^
47 | // Reduce object entries into single object
48 | .reduce((obj, entry) => Object.assign(obj, entry), {})
49 | } Use --force to continue.
帮助?