【发布时间】:2019-07-18 23:34:15
【问题描述】:
我正在尝试转换我的咖啡代码以在 gulp 任务中运行 mocha 测试。
我得到 [BABEL] /some/path/example.js: Unknown option: .targets。查看https://babeljs.io/docs/en/babel-core/#options 了解有关选项的更多信息。
这里是 gulp 任务的相关部分:
.pipe(sourcemaps.init())
.pipe(gulpif(isCoffee, coffee({ bare: true })))
.pipe(babel({ presets: [
'@babel/preset-env', {
targets: {
node: "11.10"
}
}
]
} ))
.pipe(sourcemaps.write('.'))
.pipe(mocha({ reporter: 'list' }));
}
而依赖关系是:
"@babel/cli": "^7.2.3" "@babel/core": "^7.3.3" "@babel/preset-env": "^7.3.1" "@babel/register": "^7.0.0" ... “吞咽”:“^4.0.0” "gulp-babel": "^8.0.0" ...
并且选项记录在here。
我想我一定是在什么地方漏掉了一份备忘录!
【问题讨论】:
标签: node.js gulp coffeescript mocha.js