admin管理员组文章数量:1415119
When running tsc
how do we exclude the src
folder (Root containing folder) from output? I have the outDir
set to target
and instead of target/src/file.ts
I would like target/file.ts
?
When running tsc
how do we exclude the src
folder (Root containing folder) from output? I have the outDir
set to target
and instead of target/src/file.ts
I would like target/file.ts
?
- Do you have all your code in the src folder? – Simeon Smith Commented Jul 12, 2018 at 22:37
- I'm assuming this question is related to your last one? – Patrick Roberts Commented Jul 12, 2018 at 22:37
-
@PatrickRoberts it's related in the sense that I'm pursuing creating a clean
dist or target
directory to publish from...Would be a lot easier if there was abase
package.json property though ... :) – Ole Commented Jul 12, 2018 at 22:39 -
1
How about using the
"include"
option in your tsconfig? So something like{"pilerOptions": { ... }, "include": [ "./src/" ]}
? – CRice Commented Jul 12, 2018 at 23:01 - 1 You're going to want a different tsc mand to pile your tests. You can't do both at the same time and have the src not pile to the same folder. You can chain the mands though. – Simeon Smith Commented Jul 13, 2018 at 2:53
1 Answer
Reset to default 6Your probably looking for the rootDir tsconfig option. Specifically, in your case: rootDir: 'src/'
, supposing your keeping all source files under ./src/ and your tsconfig.json at the level above src/.
Note however, tsc
may silently ignore this setting if your actually importing files that aren't under src/
, say for example you import your package.json from top level.
本文标签: javascriptExcluding the 39src39 folder from output during typescript compilationStack Overflow
版权声明:本文标题:javascript - Excluding the 'src' folder from output during typescript compilation? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745230016a2648781.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论