Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
"core:dev": "pnpm --filter core run dev",
"size": "tsx scripts/exportSize.mts"
},
"dependencies": {
"bunchee": "^4.4.8"
},
"devDependencies": {
"@babel/cli": "^7.28.0",
"@babel/core": "^7.28.0",
Expand Down
32 changes: 22 additions & 10 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,32 @@
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./useQRCode": {
"import": {
"types": "./dist/useQRCode.d.mts",
"default": "./dist/useQRCode.mjs"
"types": "./dist/useQRCode/index.d.mts",
"default": "./dist/useQRCode/index.mjs"
},
"require": {
"types": "./dist/useQRCode.d.cts",
"default": "./dist/useQRCode.cjs"
"types": "./dist/useQRCode/index.d.ts",
"default": "./dist/useQRCode/index.js"
}
},
"./*": {
"import": {
"types": "./dist/*/index.d.mts",
"default": "./dist/*/index.mjs"
},
"require": {
"types": "./dist/*/index.d.ts",
"default": "./dist/*/index.js"
}
}
},
"main": "./dist/index.cjs",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
Expand All @@ -110,8 +120,8 @@
"scripts": {
"lint": "eslint \"{hooks,tests}/**/*.{ts,tsx}\"",
"build": "esno scripts/build.ts",
"build:bunchee": "bunchee",
"dev": "bunchee --watch",
"build:tsdown": "tsdown",
"dev": "tsdown --watch",
"gend": "tsx scripts/tsdoc.ts",
"typecheck": "tsc --noEmit -p tsconfig.typecheck.json",
"publish:ci": "esno scripts/publish.ts",
Expand Down Expand Up @@ -158,6 +168,8 @@
"qrcode": "^1.5.3",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"typescript": "^5.3.3"
"tsdown": "^0.22.14",
"typescript": "^5.3.3",
"unrun": "^0.3.1"
}
}
4 changes: 2 additions & 2 deletions packages/core/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ async function buildMetaFiles() {
}

async function build() {
consola.info('Bunchee')
exec(`pnpm run build:bunchee${watch ? ' -- --watch' : ''}`, {
consola.info('tsdown')
exec(`pnpm run build:tsdown${watch ? ' -- --watch' : ''}`, {
stdio: 'inherit',
})

Expand Down
14 changes: 14 additions & 0 deletions packages/core/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from 'tsdown'

export default defineConfig({
entry: ['src/index.ts', 'src/useQRCode/index.ts'],
format: ['esm', 'cjs'],
dts: true,
// Emit one file per module (preserveModules) instead of a single bundle, so
// the published entry stays a real barrel of re-exports. Next.js
// optimizePackageImports and similar barrel-file optimizers can only unroll
// imports when the underlying per-module files exist in dist.
unbundle: true,
target: 'es2015',
platform: 'neutral',
})
Loading
Loading