diff options
Diffstat (limited to 'cli/js/compiler/sourcefile.ts')
-rw-r--r-- | cli/js/compiler/sourcefile.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/js/compiler/sourcefile.ts b/cli/js/compiler/sourcefile.ts index 159ccda85..e400acbf5 100644 --- a/cli/js/compiler/sourcefile.ts +++ b/cli/js/compiler/sourcefile.ts @@ -35,7 +35,10 @@ function getExtension(fileName: string, mediaType: MediaType): ts.Extension { case MediaType.TSX: return ts.Extension.Tsx; case MediaType.Json: - return ts.Extension.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; |