【发布时间】:2019-12-18 23:46:36
【问题描述】:
全部,
我有一个文件
// ./theme/theme.ts
export const theme = {}
现在所有的 React 组件都必须通过相对路径来解析这个模块
import {theme} from '../theme/theme'
// or
import {theme} from '../../theme/theme'
有没有办法避免这种情况,简单地说:
declare module theme {
export const theme = myTheme
}
我尝试修改tsconfig.json的baseUrl和path属性无济于事
【问题讨论】:
标签: reactjs typescript create-react-app