Skip to content

Commit

Permalink
feat: Output bundled index.{js,mjs,d.ts,d.mts} file instead of seprat…
Browse files Browse the repository at this point in the history
…e files (#273)

feat: Output bundled index.{js,mjs,d.ts,d.mts} file instead pf seprate files
  • Loading branch information
BlankParticle committed Mar 20, 2024
1 parent ea66771 commit 615b754
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
11 changes: 9 additions & 2 deletions next-themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
9 changes: 3 additions & 6 deletions next-themes/tsup.config.js → next-themes/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -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
})

0 comments on commit 615b754

Please sign in to comment.