-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: emit ESM codes if using ESM mode with Babel (#2661)
Close #2650
- Loading branch information
Showing
3 changed files
with
133 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`TsCompiler getCompiledOutput isolatedModules false should compile codes with useESM {"babelConfig": false, "supportsStaticESM": false, "useESM": true} 1`] = ` | ||
Object { | ||
"allowSyntheticDefaultImports": undefined, | ||
"esModuleInterop": true, | ||
"module": 1, | ||
} | ||
`; | ||
|
||
exports[`TsCompiler getCompiledOutput isolatedModules false should compile codes with useESM {"babelConfig": false, "supportsStaticESM": true, "useESM": false} 1`] = ` | ||
Object { | ||
"allowSyntheticDefaultImports": undefined, | ||
"esModuleInterop": true, | ||
"module": 1, | ||
} | ||
`; | ||
|
||
exports[`TsCompiler getCompiledOutput isolatedModules false should compile codes with useESM {"babelConfig": false, "supportsStaticESM": true, "useESM": true} 1`] = ` | ||
Object { | ||
"allowSyntheticDefaultImports": true, | ||
"esModuleInterop": true, | ||
"module": 99, | ||
} | ||
`; | ||
|
||
exports[`TsCompiler getCompiledOutput isolatedModules false should compile codes with useESM {"babelConfig": true, "supportsStaticESM": false, "useESM": true} 1`] = ` | ||
Object { | ||
"allowSyntheticDefaultImports": true, | ||
"esModuleInterop": true, | ||
"module": 99, | ||
} | ||
`; | ||
|
||
exports[`TsCompiler getCompiledOutput isolatedModules true should transpile code with config {"babelConfig": false, "supportsStaticESM": false, "useESM": true} 1`] = ` | ||
Object { | ||
"allowSyntheticDefaultImports": undefined, | ||
"esModuleInterop": true, | ||
"module": 1, | ||
} | ||
`; | ||
|
||
exports[`TsCompiler getCompiledOutput isolatedModules true should transpile code with config {"babelConfig": false, "supportsStaticESM": true, "useESM": false} 1`] = ` | ||
Object { | ||
"allowSyntheticDefaultImports": undefined, | ||
"esModuleInterop": true, | ||
"module": 1, | ||
} | ||
`; | ||
|
||
exports[`TsCompiler getCompiledOutput isolatedModules true should transpile code with config {"babelConfig": false, "supportsStaticESM": true, "useESM": true} 1`] = ` | ||
Object { | ||
"allowSyntheticDefaultImports": true, | ||
"esModuleInterop": true, | ||
"module": 99, | ||
} | ||
`; | ||
|
||
exports[`TsCompiler getCompiledOutput isolatedModules true should transpile code with config {"babelConfig": true, "supportsStaticESM": false, "useESM": true} 1`] = ` | ||
Object { | ||
"allowSyntheticDefaultImports": true, | ||
"esModuleInterop": true, | ||
"module": 99, | ||
} | ||
`; |
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