diff --git a/next-themes/package.json b/next-themes/package.json index 2c992e2..527a50f 100644 --- a/next-themes/package.json +++ b/next-themes/package.json @@ -8,10 +8,17 @@ "files": [ "dist" ], + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + } + }, "scripts": { "prepublish": "pnpm build", - "build": "tsup src", - "dev": "tsup src --watch", + "build": "tsup", + "dev": "tsup --watch", "test": "vitest run __tests__" }, "peerDependencies": { diff --git a/next-themes/tsup.config.js b/next-themes/tsup.config.ts similarity index 70% rename from next-themes/tsup.config.js rename to next-themes/tsup.config.ts index 0135c26..fd39d1b 100644 --- a/next-themes/tsup.config.js +++ b/next-themes/tsup.config.ts @@ -1,16 +1,13 @@ import { defineConfig } from 'tsup' export default defineConfig({ - entry: { - index: 'src/index.tsx' - }, + entry: ['src/index.tsx'], sourcemap: false, minify: true, dts: true, clean: true, external: ['react'], format: ['esm', 'cjs'], - loader: { - '.js': 'jsx' - } + splitting: false, + bundle: true })