【问题标题】:How to configure module aliases in a monorepo bootstrapped with Turborepo?Configuring module aliases in monorepo bootstrapped with turborepo
【发布时间】:2022-12-02 12:34:15
【问题描述】:

I am attempting to migrate several repositories to the mono repo architecture and am currently working on a POC bootstrapped with turbo repo.

The issue I am seeing is that ts module aliasing isn\'t configured properly. I currently have a single ui package and I am trying to export a button component from the index.tsx like so (notice, VS code not complaining, it thinks it can resolve the module):

However, when I attempt to build my application I see that the module is not in fact resolved:

Module not found: Can\'t resolve \'@/components/Button\'

I am at a loss here, does anyone know how to properly configure module aliases with turbo repo? Below is the tsconfig.json:

{
  \"extends\": \"tsconfig/react-library.json\",
  \"include\": [\".\"],
  \"exclude\": [\"dist\", \"build\", \"node_modules\"],
  \"compilerOptions\": {
    \"baseUrl\": \".\",
    \"paths\": {
      \"@/components/*\": [\"./components/*\"]
    }
  }
}
  • any updates on this?

标签: reactjs next.js monorepo turborepo


【解决方案1】:
猜你喜欢
  • 2022-01-25
  • 1970-01-01
  • 2022-12-02
  • 2022-07-02
  • 2018-07-28
  • 2022-06-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多