Skip to content
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

Provide compiled JSON to TypeScript compiler. #4404

Merged
merged 1 commit into from
Mar 18, 2020

Conversation

kitsonk
Copy link
Contributor

@kitsonk kitsonk commented Mar 16, 2020

Fixes #4101

Previously, we would just provide the raw JSON to the TypeScript compiler worker, but TypeScript does not transform JSON. This caused a problem when emitting a bundle, that the JSON would just be "inlined" into the output, instead of being transformed into a module.

This PR fixes this problem by providing the compiled JSON to the TypeScript compiler, so TypeScript just sees JSON as a "normal" TypeScript module, and emits it as a properly transformed module in the bundle.

Fixes denoland#4101

Previously, we would just provide the raw JSON to the TypeScript
compiler worker, but TypeScript does not transform JSON.  This caused
a problem when emitting a bundle, that the JSON would just be "inlined"
into the output, instead of being transformed into a module.

This fixes this problem by providing the compiled JSON to the TypeScript
compiler, so TypeScript just sees JSON as a "normal" TypeScript module.
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - sorry for the delay!

@ry ry merged commit da8cb40 into denoland:master Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] importing JSON doesn't work in bundles
2 participants