How to set up Lerna monorepo with TypeScript

后端 未结 1 1597
一整个雨季
一整个雨季 2021-01-19 17:46

I have a core library with the following in package.json:

\"main\": \"dist/cjs/index.js\",
\"module\": \"dist/esm/index.js\",
\"es2         


        
相关标签:
1条回答
  • 2021-01-19 18:06

    I resolved it with this in the root tsconfig.json:

    {
      "compilerOptions": {
        "baseUrl": "./packages",
        "paths": {
          "@test/*": ["./*/src"]
        }
      }
      ...
    }
    

    And then I added this to every package's own tsconfig.json:

    {
      "extends": "../../tsconfig.json",
      "compilerOptions": {
        "rootDir": "src"
      }
    }
    
    0 讨论(0)
提交回复
热议问题