【发布时间】:2021-07-23 20:59:11
【问题描述】:
有这样一个文件。从 API 导入并立即导出。
export { extractValue, parse, parseCommand } from './parser'
export { Manager, EVENTS } from './manager'
export { runCLI, runCommand, bootstrapCommandManager } from './cli'
我收到一个错误:
export { extractValue, parse, parseCommand } from './parser'
^^^^^^
SyntaxError: Unexpected token 'export'
这是我的 babel.config.js
module.exports = {
presets: [['@babel/preset-env', {targets: {node: 'current'}}]],
plugins: [
['@babel/plugin-transform-modules-commonjs'],
['@babel/plugin-proposal-decorators', {'legacy': true}],
['@babel/plugin-proposal-class-properties'],
['@babel/plugin-proposal-export-default-from']
]
};
@babel/plugin-proposal-export-default-from 没有帮助。
【问题讨论】:
标签: babeljs