Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions internal/core/compileroptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,11 @@ func (options *CompilerOptions) GetEmitModuleDetectionKind() ModuleDetectionKind
if options.ModuleDetection != ModuleDetectionKindNone {
return options.ModuleDetection
}
switch options.GetEmitModuleKind() {
case ModuleKindNode16, ModuleKindNode20, ModuleKindNodeNext:
moduleKind := options.GetEmitModuleKind()
if ModuleKindNode16 <= moduleKind && moduleKind <= ModuleKindNodeNext {
return ModuleDetectionKindForce
default:
return ModuleDetectionKindAuto
}
return ModuleDetectionKindAuto
}

func (options *CompilerOptions) GetResolvePackageJsonExports() bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ interface GlobalThing { a: number }
const a: GlobalThing = { a: 0 };

//// [usage.js]
"use strict";
/// <reference types="pkg" />
Object.defineProperty(exports, "__esModule", { value: true });
const a = { a: 0 };

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ module.exports = a;
const a = {};
module.exports = a;
//// [file.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// cjs format file
const a = {};
module.exports = a;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
--- old.nodeModulesAllowJsExportAssignment(module=node18).js
+++ new.nodeModulesAllowJsExportAssignment(module=node18).js
@@= skipped -33, +33 lines =@@
const a = {};
@@= skipped -34, +34 lines =@@
module.exports = a;
//// [file.js]
-"use strict";
"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
// cjs format file
const a = {};
module.exports = a;
@@= skipped -16, +15 lines =@@
@@= skipped -15, +16 lines =@@


//// [index.d.ts]
Expand Down
Loading