Skip to content

Commit

Permalink
🏷️ Fix types in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuapp committed Sep 19, 2024
1 parent 95dda9d commit 6041521
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions build_npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,20 @@ const packageJson = {
bugs: {
url: "https://github.com/ryuapp/enogu/issues",
},
type: "module",
main: "./cjs/colors.cjs",
module: "./esm/colors.mjs",
types: "./types/colors.d.cts",
exports: {
".": {
types: "./types/colors.d.ts",
import: "./esm/colors.mjs",
require: "./cjs/colors.cjs",
import: {
types: "./types/colors.d.ts",
default: "./esm/colors.mjs",
},
require: {
types: "./types/colors.d.cts",
default: "./cjs/colors.cjs",
},
},
},
devDependencies: {},
Expand Down Expand Up @@ -84,10 +91,12 @@ for (const file of fileList) {
const inputText = decoder.decode(content);
const minifiedText = minifier.minify(inputText, { keepJsDocs: true });

Deno.writeFile(
`${outDir}/types/${file}.d.ts`,
new TextEncoder().encode(minifiedText),
);
for (const ext of [".d.ts", ".d.cts"]) {
Deno.writeFile(
`${outDir}/types/${file}${ext}`,
new TextEncoder().encode(minifiedText),
);
}
}

// package.json
Expand Down

0 comments on commit 6041521

Please sign in to comment.