import { defineConfig } from 'tsdown'; import { checkPackage } from './scripts/check-package.mjs'; export default defineConfig({ // Workspace configuration - builds all library packages from root workspace: { include: ['packages/*', 'plugins/*', 'tools/*', 'tegg/core/*', 'tegg/plugin/*', 'tegg/standalone/*'], exclude: [ 'packages/tsconfig', // Config-only package, no src to build 'packages/skills', // Pure markdown package, no src to build 'dist', ], }, // Shared defaults unused: { level: 'error', }, exports: { devExports: true, }, fixedExtension: false, // Use utoo explicitly; tsdown's package-manager detector chooses pnpm // from the legacy workspace file even after the native utoo migration. publint: false, hooks: { 'build:done': async ({ options }) => { if (options.pkg && !options.pkg.private) { await checkPackage(options.pkg.packageJsonPath); } }, }, // Default entry pattern - glob to include all source files entry: 'src/**/*.ts', // should set unbundle and external together, avoid bundle @eggjs/* and egg packages. // `@utoo/pack` ships prebuilt NAPI-RS binaries (`*.node`), and its transitive // `domparser-rs` does the same — rolldown cannot analyse those binary files, // so keep both the package and any `.node` binary fully external. unbundle: true, external: [/^@eggjs\//, 'egg', '@utoo/pack', /\.node$/], });