diff --git a/package.json b/package.json index c866bb2..b795554 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,11 @@ "license": "MIT", "author": "KATT", "type": "module", + "exports": { + "import": "./lib/index.js", + "require": "./lib/index.cjs", + "default": "./lib/index.js" + }, "main": "./lib/index.js", "files": [ "lib/", diff --git a/tsup.config.ts b/tsup.config.ts index 43c6f24..6624b1d 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ clean: true, dts: true, entry: ["src/**/*.ts", "!src/**/*.test.*"], - format: "esm", + format: ["cjs", "esm"], outDir: "lib", sourcemap: true, });