diff --git a/.changeset/moody-goats-check.md b/.changeset/moody-goats-check.md new file mode 100644 index 0000000..b2f4a50 --- /dev/null +++ b/.changeset/moody-goats-check.md @@ -0,0 +1,9 @@ +--- +'@blizzard-api/classic-wow': patch +'@blizzard-api/client': patch +'@blizzard-api/core': patch +'@blizzard-api/wow': patch +'@blizzard-api/d3': patch +--- + +Improve dual publishing of cjs and esm, as well as improve treeshaking through tsup diff --git a/packages/classic-wow/package.json b/packages/classic-wow/package.json index d5fe4c1..9b0fcbe 100644 --- a/packages/classic-wow/package.json +++ b/packages/classic-wow/package.json @@ -9,7 +9,9 @@ "engines": { "node": "^18.18 || ^20.9 || ^21.1 || ^22" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", "exports": { "import": { "types": "./dist/index.d.ts", diff --git a/packages/client/package.json b/packages/client/package.json index d6a1854..75c925d 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -9,7 +9,9 @@ "engines": { "node": "^18.18 || ^20.9 || ^21.1 || ^22" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", "exports": { "import": { "types": "./dist/index.d.ts", diff --git a/packages/core/package.json b/packages/core/package.json index b13aa75..a54a1e5 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -9,7 +9,9 @@ "engines": { "node": "^18.18 || ^20.9 || ^21.1 || ^22" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", "exports": { "import": { "types": "./dist/index.d.ts", diff --git a/packages/d3/package.json b/packages/d3/package.json index d70f3d7..69363da 100644 --- a/packages/d3/package.json +++ b/packages/d3/package.json @@ -9,7 +9,9 @@ "engines": { "node": "^18.18 || ^20.9 || ^21.1 || ^22" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", "exports": { "import": { "types": "./dist/index.d.ts", diff --git a/packages/wow/package.json b/packages/wow/package.json index d5be179..1f16231 100644 --- a/packages/wow/package.json +++ b/packages/wow/package.json @@ -9,7 +9,9 @@ "engines": { "node": "^18.18 || ^20.9 || ^21.1 || ^22" }, - "main": "./dist/index.js", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", "exports": { "import": { "types": "./dist/index.d.ts", diff --git a/tsconfig.json b/tsconfig.json index 62435c4..5de917a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,7 @@ "noFallthroughCasesInSwitch": true, /* Default library settings */ - "lib": ["ES2022"], + "lib": ["ESNext"], /* Vite specific settings */ "types": ["vitest/importMeta"], diff --git a/tsup.config.ts b/tsup.config.ts index 2e92fb4..2279a30 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -10,5 +10,6 @@ export default defineConfig(({ watch = false }) => ({ format: ['cjs', 'esm'], outDir: 'dist', sourcemap: true, + treeshake: true, watch, }));