New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deep config loading for typescript #646
Conversation
Codecov Report
@@ Coverage Diff @@
## master #646 +/- ##
==========================================
- Coverage 89.15% 89.12% -0.04%
==========================================
Files 62 62
Lines 1991 2013 +22
==========================================
+ Hits 1775 1794 +19
- Misses 216 219 +3
Continue to review full report at Codecov.
|
5d9cafb
to
91bd5f2
Compare
Rebased on latest master |
Just wondering: Typescript already has an "official" way to load the config file - the Why not use this API? |
Sounds like a good idea, I'll look into it. Main worry was that parcel wont know which files to watch/track, but I'll check if the whole hierarchy can maybe be extracted and added to the watchlist. |
Yep, we need to do our own resolution so that Parcel knows which files to watch |
Oh, I see - the API function only returns the config, but not which files have been traversed to build it. A bit unlikely for watching. In that case, I'd argue that E.g: {
"compilerOptions": {
"target": "es5",
"module": "esnext"
}
} extended by {
"extends": "./tsconfig.base",
"compilerOptions": {
"module": "commonjs"
}
} has to result in {
"compilerOptions": {
"target": "es5",
"module": "commonjs"
}
} Another issue would be that - as you see in the examples above - it is not required to explicitly provide the file extension of the extended file. This is also described in the official docs in the |
6ed7c1d
to
3bd66f6
Compare
So I managed to fix this by implementing a custom parse config host that tracks all the read files. I don't like how unclean the result ended up, but I didn't see any opportunities for improvements due to the strict non-async config host API. Let me know if you see any opportunities to improve this. Also, let me know if you want me to remove that compiler host interface comment, I thought it might come handy if someone wants to make changes to the host. Is there a way to write a test that determines whether the right files end up in the watchlist? |
3bd66f6
to
2810d8a
Compare
Adds support for the "extends" property of typescript configs.
2810d8a
to
2fb838d
Compare
Some concerns I have
|
The compiler host interface comment should be OK, since there is no other way to illustrate the API you're trying to adhere to.
IIRC, an issue regarding bad transformation performance raised in |
Closing this due to inactivity. Perhaps we can come back to this in the future. |
Adds support for the "extends" property of typescript configs.