Log*_*phy 13 javascript node.js reactjs next.js turborepo
我正在尝试将多个存储库迁移到 monorepo 架构,目前正在开发使用Turborepo引导的 POC 。
我看到的问题是 ts 模块别名配置不正确。我目前有一个 ui 包,我正在尝试从中导出一个按钮组件index.tsx(注意,VS code 没有抱怨,它认为它可以解析该模块):

但是,当我尝试构建我的应用程序时,我发现该模块实际上并未解析:
找不到模块:无法解析“@/components/Button”
我在这里不知所措,有谁知道如何使用 Turbo repo 正确配置模块别名?以下是 tsconfig.json:
{
"extends": "tsconfig/react-library.json",
"include": ["."],
"exclude": ["dist", "build", "node_modules"],
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/components/*": ["./components/*"]
}
}
}Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3394 次 |
| 最近记录: |