We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在开发模式下,经常会用到 Go To Definition 这个功能,但是对于 package 下的 library,它们虽然是用 TS 写的,但是实际中项目引用的是 tsc -w 产生的 JS 文件,所以即使开了 declaration: true,也只能跳转到对应 TS 文件产生的 d.ts 上。 **解决方法:**使用 tsconfig 的 paths,
tsc -w
declaration: true
{ "compilerOptions": { "paths": { "@monodemo/service": ["../../service/src/index"], "@monodemo/permission-detail": ["../../permission-detail/src/index"], "@monodemo/check": ["../../check-detail/src/index"] } } }
将 package 名直接映射给对应包的 index.tsx 文件,这其中有两个点需要注意
{ test: /\.(ts|tsx)$/, include: paths.appSrc, loader: require.resolve('ts-loader'), options: { configFile: paths.appTsConfig, }, },
https://medium.com/@NiGhTTraX/how-to-set-up-a-typescript-monorepo-with-lerna-c6acda7d4559
The text was updated successfully, but these errors were encountered:
No branches or pull requests
让 monorepo 的使用更加丝滑
全局的 TypeScript 类型
TypeScript 跳转
在开发模式下,经常会用到 Go To Definition 这个功能,但是对于 package 下的 library,它们虽然是用 TS 写的,但是实际中项目引用的是
tsc -w
产生的 JS 文件,所以即使开了declaration: true
,也只能跳转到对应 TS 文件产生的 d.ts 上。**解决方法:**使用 tsconfig 的 paths,
将 package 名直接映射给对应包的 index.tsx 文件,这其中有两个点需要注意
https://medium.com/@NiGhTTraX/how-to-set-up-a-typescript-monorepo-with-lerna-c6acda7d4559
The text was updated successfully, but these errors were encountered: