-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[bug] importing JSON doesn't work in bundles #4101
Comments
kitsonk
added a commit
to kitsonk/deno
that referenced
this issue
Mar 16, 2020
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.
kitsonk
added a commit
to kitsonk/deno
that referenced
this issue
Mar 17, 2020
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.
ry
pushed a commit
that referenced
this issue
Mar 18, 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 fixes this problem by providing the compiled JSON to the TypeScript compiler, so TypeScript just sees JSON as a "normal" TypeScript module.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Breaking this out of #4062 as the fix might land differently.
JSON is not importable to bundles currently. This is because we need to do the transformation into an ESM ourselves, as TypeScript will strongly type it, but expects the host to do the transformation.
The text was updated successfully, but these errors were encountered: