Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
我不知道什么是最好的结构,当然它是上下文相关的。我的目标是快速开始。
我确实有一个解决方案,就是在前端存储库中嵌套 functions 目录时出现重复类型错误,如下所示:
functions
|-frontend |-functions |-node_modules |-src |-tsconfig.json |-node_modules |-src
我们需要在 tsconfig.json< 中指定 typeRoots functions 目录的 /code> 或其他类型将遍历到父 node_modules。
tsconfig.json< 中指定 typeRoots functions 目录的 /code> 或其他类型将遍历到父 node_modules。
typeRoots
node_modules
"compilerOptions": { "typeRoots": [ "./node_modules/@types" ] } }
I don't have an answer for what the best structure would be, surely it's contextual. My goal was to get to started quickly.
What I do have a solution for is the duplicate type errors when nesting functions directory in your frontend repo like so:
We need to specify typeRoots in tsconfig.json of the functions directory or else types get traversed up to the parent node_modules.
tsconfig.json
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
我不知道什么是最好的结构,当然它是上下文相关的。我的目标是快速开始。
我确实有一个解决方案,就是在前端存储库中嵌套
functions
目录时出现重复类型错误,如下所示:我们需要在
tsconfig.json< 中指定
typeRoots
functions
目录的 /code> 或其他类型将遍历到父node_modules
。I don't have an answer for what the best structure would be, surely it's contextual. My goal was to get to started quickly.
What I do have a solution for is the duplicate type errors when nesting
functions
directory in your frontend repo like so:We need to specify
typeRoots
intsconfig.json
of thefunctions
directory or else types get traversed up to the parentnode_modules
.