Skip to content

Commit bed73cc

Browse files
committed
Maybe fix the default thing
1 parent 10a07ad commit bed73cc

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

scripts/dtsBundler.mjs

+2
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ function isSelfReference(reference, symbol) {
357357
* @param {ts.Symbol} moduleSymbol
358358
*/
359359
function emitAsNamespace(name, parent, moduleSymbol, needExportModifier) {
360+
if (name === "default") return;
361+
360362
assert(moduleSymbol.flags & ts.SymbolFlags.ValueModule, "moduleSymbol is not a module");
361363

362364
const fullName = parent ? `${parent}.${name}` : name;

src/typescript/typescript.ts

+2
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ if (typeof console !== "undefined") {
2323
}
2424

2525
export * from "./_namespaces/ts.js";
26+
import * as ts from "./_namespaces/ts.js";
27+
export default ts;

testImportESM.mjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as ts from "./built/local/typescript.js";
2+
import ts2 from "./built/local/typescript.js";
3+
4+
console.log(ts.version);
5+
console.log(ts2.version);

0 commit comments

Comments
 (0)