【发布时间】:2019-04-02 10:59:16
【问题描述】:
我不确定我的构建是否良好,但在我的package.json 中,我有
"scripts": {
"build": "flow-remove-types src/ -d build/",
我有一个types/sentence.js,它有:
// @flow
type SentenceObject = {
foo: number,
bar: boolean,
baz: string,
};
module.exports = {
SentenceObject
};
在我的库文件中,我有:
const { SentenceObject } = require('../interfaces/sentence');
问题,当我yarn build 是:
src/interfaces/sentence.js
↳ Syntax Error: Unexpected token, expected = (3:27)
2: export type SentenceObject {
我做错了什么?
【问题讨论】:
标签: flowtype