I am using yarn workspaces for my project, with following structure
root
packages
app1
tsconfig.json
app2
ui-kit
ant-design
index.d.ts
tsconfig.json
tsconfig.json
in index.d.ts
I am re-exporting antd
component wrapped with additional props, but antd
has a lot of types in antd/es/*
I need to use in my project.
I dont want to re-export all of them (because there is a lot of them and structure might change).
So I modified ui-kit/tsconfig.json
to be
{
"extends": "@my-config-lib/tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"ant-design/es/*": ["node_modules/antd/es/*"]
},
},
"include": ["**/*.ts", "**/*.tsx", "**/*.d.ts"],
"exclude": ["dist", "node_modules"]
}
While this help me to import from within ui-ki
using ./ant-design/es/menu/etc
This does not work when this ui-kit
is used in app1
or app2
.
I tried setting references
in app1/tsconfig.json
but that does not seem to help.
Also i have tried adding paths
in app1/tsconfig.json
to be "@fineapp/ui-kit/antd-design/es*" : "../ui-kit/node_modules/antd/es/*"
but also no luck.
Is there a way to tell app1/tsconfig
to look for paths
in ui-kit/tsconfig.json
while trying import code from it ?