Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ts] Support
import ... =
and export =
in scripts
- Loading branch information
1 parent
a04c976
commit 07e71ed
Showing
11 changed files
with
58 additions
and
21 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
1 change: 1 addition & 0 deletions
1
packages/babel-plugin-transform-typescript/test/fixtures/exports/export=-script/input.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 @@ | ||
export = 0; |
3 changes: 3 additions & 0 deletions
3
packages/babel-plugin-transform-typescript/test/fixtures/exports/export=-script/options.json
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,3 @@ | ||
{ | ||
"sourceType": "script" | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-plugin-transform-typescript/test/fixtures/exports/export=-script/output.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 @@ | ||
module.exports = 0; |
2 changes: 1 addition & 1 deletion
2
packages/babel-plugin-transform-typescript/test/fixtures/exports/export=/options.json
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"throws": "`export =` is not supported by @babel/plugin-transform-typescript\nPlease consider using `export <value>;`." | ||
"throws": "`export = <value>;` is only supported when \"sourceType\" is \"script\".\nPlease consider using `export default <value>;`" | ||
} |
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
packages/babel-plugin-transform-typescript/test/fixtures/imports/import=-module/options.json
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,4 @@ | ||
{ | ||
"sourceType": "module", | ||
"throws": "`import lib = require(...);` is only supported when \"sourceType\" is \"script\".\nPlease consider using `import lib from '...';` alongside Typescript's --allowSyntheticDefaultImports option." | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/babel-plugin-transform-typescript/test/fixtures/imports/import=-script/input.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,2 @@ | ||
import lib = require("lib"); | ||
lib(); |
3 changes: 3 additions & 0 deletions
3
packages/babel-plugin-transform-typescript/test/fixtures/imports/import=-script/options.json
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,3 @@ | ||
{ | ||
"sourceType": "script" | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/babel-plugin-transform-typescript/test/fixtures/imports/import=-script/output.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,2 @@ | ||
const lib = require("lib"); | ||
lib(); |
3 changes: 0 additions & 3 deletions
3
packages/babel-plugin-transform-typescript/test/fixtures/imports/import=/options.json
This file was deleted.
Oops, something went wrong.