Skip to content

Commit

Permalink
Improved npm build script
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderOMara committed Dec 15, 2024
1 parent ef01701 commit 485c5e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ const keywords = readme.map((s) => s.match(/^\!\[(.*)\]\((.*)\)$/))

const entryPoints = [];
let types: string | undefined;
const typed: { [s: string]: string[] } = {};
let typed: { [s: string]: string[] } | null = null;
for (const [name, path] of Object.entries(denoJson.exports)) {
const d = path.replace(/^(\.\/)?(.*)(\.[^.]+)$/i, './esm/$2.d$3');
if (name === '.') {
entryPoints.unshift(path);
types = d;
} else {
entryPoints.push({ name, path });
typed[name.replace(/^\.\//, '')] = [d];
(typed ??= {})[name.replace(/^\.\//, '')] = [d];
}
}

Expand Down

0 comments on commit 485c5e5

Please sign in to comment.