mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 22:51:17 -05:00
improve module loading interoperability for babel
This commit is contained in:
@@ -2709,6 +2709,17 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
}
|
||||
else {
|
||||
if (node.flags & NodeFlags.Default) {
|
||||
if (compilerOptions.module === ModuleKind.CommonJS || compilerOptions.module === ModuleKind.AMD || compilerOptions.module === ModuleKind.UMD) {
|
||||
write("Object.defineProperty(exports, \"__esModule\", {");
|
||||
writeLine();
|
||||
increaseIndent();
|
||||
// default value of configurable, enumerable, writable are `false`.
|
||||
write("value: true");
|
||||
writeLine();
|
||||
decreaseIndent();
|
||||
write("};");
|
||||
writeLine();
|
||||
}
|
||||
if (languageVersion === ScriptTarget.ES3) {
|
||||
write("exports[\"default\"]");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user