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:
Bartek Iwańczuk 2020-05-02 00:32:05 +02:00 committed by GitHub
parent 96fd0f4692
commit de2c042482
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 15 additions and 137 deletions

View file

@ -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;