mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 07:01:16 +00:00
BREAKING: remove support for JSON imports (#5037)
This commit removes support for importing JSON files as modules. This change is dictated by security; browsers rolled back on this support as well.
This commit is contained in:
parent
96fd0f4692
commit
de2c042482
11 changed files with 15 additions and 137 deletions
|
@ -34,11 +34,6 @@ function getExtension(fileName: string, mediaType: MediaType): ts.Extension {
|
|||
return fileName.endsWith(".d.ts") ? ts.Extension.Dts : ts.Extension.Ts;
|
||||
case MediaType.TSX:
|
||||
return ts.Extension.Tsx;
|
||||
case MediaType.Json:
|
||||
// we internally compile JSON, so what gets provided to the TypeScript
|
||||
// compiler is an ES module, but in order to get TypeScript to handle it
|
||||
// properly we have to pretend it is TS.
|
||||
return ts.Extension.Ts;
|
||||
case MediaType.Wasm:
|
||||
// Custom marker for Wasm type.
|
||||
return ts.Extension.Js;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue