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?
Your 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With