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,7 +0,0 @@
import { defineBuildConfig } from 'unbuild';
export default defineBuildConfig({
clean: true,
declaration: true,
entries: ['src/index'],
});

View File

@@ -11,14 +11,15 @@
"license": "MIT",
"type": "module",
"scripts": {
"build": "pnpm unbuild"
"build": "tsdown"
},
"files": [
"dist"
"dist",
"vue-router.d.ts"
],
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"types": "./dist/index.d.mts",
"exports": {
".": {
"types": "./src/index.ts",
@@ -32,7 +33,7 @@
"publishConfig": {
"exports": {
".": {
"types": "./dist/index.d.ts",
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
}

View File

@@ -0,0 +1,8 @@
import { defineConfig } from 'tsdown';
export default defineConfig({
clean: true,
dts: true,
entry: ['src/index.ts'],
format: ['esm'],
});

View File

@@ -1,5 +1,5 @@
/* eslint-disable no-restricted-imports */
import type { RouteMeta as IRouteMeta } from '@vben-core/typings';
import type { RouteMeta as IRouteMeta } from './dist/index.d.mts';
import 'vue-router';