build: migrate core ts packages to tsdown

This commit is contained in:
xingyu4j
2026-03-15 18:13:49 +08:00
parent ab3e6bb37c
commit ae6a75e913
22 changed files with 297 additions and 60 deletions

View File

@@ -1,14 +0,0 @@
import { defineBuildConfig } from 'unbuild';
export default defineBuildConfig({
clean: true,
declaration: true,
entries: [
'src/store',
'src/constants/index',
'src/utils/index',
'src/color/index',
'src/cache/index',
'src/global-state',
],
});

View File

@@ -11,8 +11,8 @@
"license": "MIT",
"type": "module",
"scripts": {
"build": "pnpm unbuild",
"stub": "pnpm unbuild --stub"
"build": "tsdown",
"stub": "tsdown"
},
"files": [
"dist"
@@ -53,27 +53,27 @@
"publishConfig": {
"exports": {
"./constants": {
"types": "./dist/constants/index.d.ts",
"types": "./dist/constants/index.d.mts",
"default": "./dist/constants/index.mjs"
},
"./utils": {
"types": "./dist/utils/index.d.ts",
"types": "./dist/utils/index.d.mts",
"default": "./dist/utils/index.mjs"
},
"./color": {
"types": "./dist/color/index.d.ts",
"types": "./dist/color/index.d.mts",
"default": "./dist/color/index.mjs"
},
"./cache": {
"types": "./dist/cache/index.d.ts",
"types": "./dist/cache/index.d.mts",
"default": "./dist/cache/index.mjs"
},
"./store": {
"types": "./dist/store.d.ts",
"types": "./dist/store.d.mts",
"default": "./dist/store.mjs"
},
"./global-state": {
"types": "./dist/global-state.d.ts",
"types": "./dist/global-state.d.mts",
"default": "./dist/global-state.mjs"
}
}

View File

@@ -0,0 +1,15 @@
import { defineConfig } from 'tsdown';
export default defineConfig({
clean: true,
dts: true,
entry: {
'cache/index': 'src/cache/index.ts',
'color/index': 'src/color/index.ts',
'constants/index': 'src/constants/index.ts',
'global-state': 'src/global-state.ts',
'store': 'src/store.ts',
'utils/index': 'src/utils/index.ts',
},
format: ['esm'],
});