3.6.24之后版本,组件不在src目录下ts type报错 #15753
-
这个特性解决了什么问题?有没有配置可以自定义某些非src目录支持ts 这个 API 长什么样? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
好像和pnpm workspace symlinks有关, ln -s 的文件夹有问题,, |
Beta Was this translation helpful? Give feedback.
-
resolve symlinks: true 不知道是不是解析真实地址影响,pnpm workspace ln -s npm link 真实地址不在src下 ts type报错 |
Beta Was this translation helpful? Give feedback.
-
同样的问题,通过 alias 配置引用了项目根目录以外的文件,在 dev 和 build 时都会报 ts 类型错误 |
Beta Was this translation helpful? Give feedback.
-
把文件加入到 tsconfig 的 include 内 |
Beta Was this translation helpful? Give feedback.
-
准确地说,不是 TS 类型错误,是 TS 文件没被 babel-loader 编译,当成 JS 模块加载,有语法识别不了的报错。 |
Beta Was this translation helpful? Give feedback.
把文件加入到 tsconfig 的 include 内