Skip to content

Commit

Permalink
Maybe fix the default thing
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed May 7, 2024
1 parent 10a07ad commit bed73cc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/dtsBundler.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ function isSelfReference(reference, symbol) {
* @param {ts.Symbol} moduleSymbol
*/
function emitAsNamespace(name, parent, moduleSymbol, needExportModifier) {
if (name === "default") return;

assert(moduleSymbol.flags & ts.SymbolFlags.ValueModule, "moduleSymbol is not a module");

const fullName = parent ? `${parent}.${name}` : name;
Expand Down
2 changes: 2 additions & 0 deletions src/typescript/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ if (typeof console !== "undefined") {
}

export * from "./_namespaces/ts.js";
import * as ts from "./_namespaces/ts.js";
export default ts;
5 changes: 5 additions & 0 deletions testImportESM.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * as ts from "./built/local/typescript.js";
import ts2 from "./built/local/typescript.js";

console.log(ts.version);
console.log(ts2.version);

0 comments on commit bed73cc

Please sign in to comment.