react-workspaces-playground icon indicating copy to clipboard operation
react-workspaces-playground copied to clipboard

how can i use baseUrl in components

Open yanghoxom opened this issue 5 years ago • 4 comments

I have added jsconfig.json But it doesn't seem to work packages/components/jsconfig.json run with command: yarn start:app-ant-design @F1LT3R can you help me ?

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "modules/*": ["src/modules/*"],
      "graphql/*": ["src/graphql/*"]
    }
  }
}

yanghoxom avatar May 04 '20 04:05 yanghoxom

I thought jsconfig.json only worked in the root of your workspace. Is this wrong?

I'm not 100% sure how you're trying to use this. Can you add more context?

F1LT3R avatar May 06 '20 19:05 F1LT3R

@F1LT3R in packages/components I want to use baseUrl so I can use absolute path but when i put jsconfig.json to packages/components. it not work. always get message undefine xxx from import..

yanghoxom avatar May 07 '20 10:05 yanghoxom

Do you have other projects where jconfig.json works without it being in the root of the workspace?

F1LT3R avatar May 07 '20 13:05 F1LT3R

@F1LT3R no, jsconfig.json seem not work with this template

yanghoxom avatar May 15 '20 04:05 yanghoxom