-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Support <script src="tsconfig.json"></script> as asset type #1627
Comments
I'm not sure if we can swap Parcel Resolver with TypeScript. It does a lot of things: Lines 10 to 23 in 2aa7215
|
In this case TypeScript will only go as far as resolving within its set of The result of TS compilation will pipe through the same sophisticated |
Not a fan of this approach - it feels slightly off-mark of the zero-config goal of Parcel to require an extra configuration step for proper typescript support. I think it's safe to say the vast majority of devs looking to use typescript in parcel are getting a sub-optimal experience when they directly import a ts/tsx file. The correct default behavior should be to use the |
@mmmeff I am totally confused — you've described what I have suggested, and actually that is your preferred correct way, but at the same time you disagree with it? The original suggestion is to avoid reinventing the wheel, and rely on TS wheels more. It would be great to be able to use a whole of |
Parcel 2's resolver supports tsconfig settings. |
🙋 feature request
Parcel
handles TypeScript compilation/post-processing in its custom way, which limits certain useful TS scenarios.To allow simple way to use full TS feature set, it would be super cool to let TS handle more through
tsconfig.json
, and feed results intoparcel
pipeline at that stage.Suggested approach
When
.ts
asset is referred, the usualparcel
handling is used. But iftsconfig.json
is used as asset,parcel
fires TS compiler, which discovers and processes inputs on its own.TypeScript would produce one or many outputs, which
parcel
would then pass through its remaining processing/transforms.The disk cache would be less involved in this case, as processing is not file-per-file anymore. But in-memory partial recompilation is a part of TS compiler.
The text was updated successfully, but these errors were encountered: