-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support json module emit when module emit is commonjs, amd, es2015 or…
- Loading branch information
1 parent
acc3502
commit 0c77406
Showing
16 changed files
with
97 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmd.errors.txt
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmdOutFile.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//// [tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitAmdOutFile.ts] //// | ||
|
||
//// [file1.ts] | ||
import * as b from './b.json'; | ||
|
||
//// [b.json] | ||
{ | ||
"a": true, | ||
"b": "hello" | ||
} | ||
|
||
//// [out/output.js] | ||
define("b", [], { | ||
"a": true, | ||
"b": "hello" | ||
}); | ||
define("file1", ["require", "exports"], function (require, exports) { | ||
"use strict"; | ||
exports.__esModule = true; | ||
}); |
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmdOutFile.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
=== tests/cases/compiler/file1.ts === | ||
import * as b from './b.json'; | ||
>b : Symbol(b, Decl(file1.ts, 0, 6)) | ||
|
||
=== tests/cases/compiler/b.json === | ||
{ | ||
"a": true, | ||
>"a" : Symbol("a", Decl(b.json, 0, 1)) | ||
|
||
"b": "hello" | ||
>"b" : Symbol("b", Decl(b.json, 1, 14)) | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmdOutFile.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
=== tests/cases/compiler/file1.ts === | ||
import * as b from './b.json'; | ||
>b : { "a": boolean; "b": string; } | ||
|
||
=== tests/cases/compiler/b.json === | ||
{ | ||
>{ "a": true, "b": "hello"} : { "a": boolean; "b": string; } | ||
|
||
"a": true, | ||
>"a" : boolean | ||
>true : true | ||
|
||
"b": "hello" | ||
>"b" : string | ||
>"hello" : "hello" | ||
} |
12 changes: 0 additions & 12 deletions
12
tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.errors.txt
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.errors.txt
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitNone.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitSystem.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUmd.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitAmdOutFile.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// @module: amd | ||
// @moduleResolution: node | ||
// @outFile: out/output.js | ||
// @fullEmitPaths: true | ||
// @resolveJsonModule: true | ||
|
||
// @Filename: file1.ts | ||
import * as b from './b.json'; | ||
|
||
// @Filename: b.json | ||
{ | ||
"a": true, | ||
"b": "hello" | ||
} |