please document project references and outdir
See original GitHub issueReally really unclear documentation regarding the behavior of “project references” and outDir.
I can’t believe how unclear this is – please please tell me how I’m supposed to do this …
> checkmate-node-monorepo@0.0.1 build /Users/ncohen/software/itsacheckmate.com/Web
> tsc --build --verbose
[11:01:04 AM] Projects in this build:
* lib/pdf-api/tsconfig.json
* tsconfig.json
[11:01:04 AM] Project 'lib/pdf-api/tsconfig.json' is out of date because output file 'lib/pdf-api/src/DoordashFailureSamples.js' does not exist
[11:01:04 AM] Building project '/Users/ncohen/software/itsacheckmate.com/Web/lib/pdf-api/tsconfig.json'...
[11:01:07 AM] Project 'tsconfig.json' is out of date because oldest output 'lib/pdf-api/src/DoordashPdfSemantics.js' is older than newest input 'lib/pdf-api'
[11:01:07 AM] Building project '/Users/ncohen/software/itsacheckmate.com/Web/tsconfig.json'...
[11:01:09 AM] Updating unchanged output timestamps of project '/Users/ncohen/software/itsacheckmate.com/Web/tsconfig.json'...
ncohen@breathe-book ~/s/i/Web> cat tsconfig.json
{
"references": [{ "path": "./lib/pdf-api" }]
}
ncohen@breathe-book ~/s/i/Web> cat ./lib/pdf-api/tsconfig.json
{
"extends": "../../tsconfig_base.json",
"include": ["./src/**/*.ts"],
"exclude": ["node_modules"]
}
ncohen@breathe-book ~/s/i/Web> cat ./tsconfig_base.json
{
"compilerOptions": {
"composite": true,
"outDir": "compiled-js",
"target": "es2016",
"lib": ["es2016"],
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"experimentalDecorators": false,
"pretty": true,
"strict": true,
"strictFunctionTypes": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"forceConsistentCasingInFileNames": true,
"strictNullChecks": true,
"declaration": true,
"declarationMap": true
}
}
Why are compiled files being written to ./lib/pdf-api/src/ directory? How can I have that NOT happen? Or if I have to have something written to my src directory (for some reason …?) can I have only a single file written there which I can reliable gitignore …?
ncohen@breathe-book ~/s/i/Web> tsc --version
Version 3.5.2
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Project references in TypeScript 3 with separate `outDir`
Is there a way to get it working without putting all output files into the same directory? Or, is there a better way...
Read more >MSBuild warning MSB8012 - Microsoft Learn
This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property ...
Read more >Documentation - Project References - TypeScript
Project references are a new feature in TypeScript 3.0 that allow you to structure your TypeScript programs into smaller pieces.
Read more >Output from referenced C++ project not copied to output folder ...
The problem is that the main C++ project references another C++ projects, ... If we haven't resolved this issue for you, please report...
Read more >Configuration - Sphinx documentation
Please read a document of the extension to know which file type the ... If true, Sphinx will warn about all references where...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @DanielRosenwasser – using that example I was able to get going correcty.
The behavior of this feature with respect to rules like outDir and rootDir is pretty confusing – official documentation of the feature via example repo’s would seem a nice approach to me!
The individual flag documentation is great but I find that it’s a lot of work to try to infer from those what a reasonable project setup looks like. Having guidelines here could help projects adopt these features and set conventions.
For example my first reaction was to build a project something like:
but I was then surprised to find that my test file had to use
import * from "../dist/module"
rather thanimport * from "../src/module"
despite having project references in place. It wasn’t clear to me if that was a sign of a misconfigured project, incorrect expectations for how these features work, or something else.