我有Vite + React + TypeScript应用程序与 struct
src
constants
a.ts
b.ts
index.ts
components
Comp.tsx
tsconfig与"baseUrl": "src"
a.ts个内容:
export const ARRAY = [1, 2, 3];
b.ts个内容:
export const Object = { foo: 'bar' };
index.ts内容:
export * from './a';
export * from './b';
Comp.tsx内容:
import { ARRAY } from 'constants';
应用程序运行正常,但在WebStorm中出现错误,单位为Comp.tsx:
TS2305: Module "constants" has no exported member ARRAY
为什么?我该怎么补救?
我想摆脱这个错误.