【发布时间】:2018-05-04 09:35:34
【问题描述】:
import('react-ace').then(function (component) {
^^^^^^
SyntaxError: Unexpected token import
22 | />
23 | );
> 24 | ButtonList.defaultProps = {
25 | text: '',
26 | primary: false,
27 | onclick: null,
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:316:17)
当我使用 jest 运行测试用例时会发生上述错误。 我正在使用 react、webpack 和 jest。
【问题讨论】:
-
你能分享你的 package.json 和 babelrc 吗?