Skip to content

Commit

Permalink
Fix missing esm file in the build output (#7)
Browse files Browse the repository at this point in the history
* fix: remove type module option from package.json, fixes #6

This option also changes the outputs of tsup. So it does not output
index.mjs file but instead index.js and index.cjs files. This breaks esm
imports

* chore: set tsup version to ^8 to prevent future issues

* chore: change tsup config for consistency with other packages
  • Loading branch information
ytkimirti authored Nov 21, 2024
1 parent 7ed19eb commit 50894ae
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
Binary file modified bun.lockb
Binary file not shown.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"type": "module",
"scripts": {
"test": "bun test",
"fmt": "prettier --write .",
Expand Down Expand Up @@ -45,7 +44,7 @@
"eslint-plugin-unicorn": "^51.0.1",
"husky": "^9.0.10",
"prettier": "^3.2.5",
"tsup": "latest",
"tsup": "^8.2.3",
"typescript": "^5.4.5",
"vitest": "latest"
},
Expand Down
4 changes: 1 addition & 3 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { defineConfig } from "tsup";

export default defineConfig({
entry: ["./index.ts"],
entry: ["index.ts"],
format: ["cjs", "esm"],
sourcemap: false,
clean: true,
dts: true,
minify: true,
});

0 comments on commit 50894ae

Please sign in to comment.