import { defineConfig } from 'tsdown' export default defineConfig({ entry: { index: './src/index.ts' }, platform: 'neutral', format: ['esm'], dts: true, sourcemap: true, hash: false, clean: true, outDir: './dist', treeshake: { moduleSideEffects: false }, deps: { neverBundle: ['@open-pencil/scene-graph', /^@open-pencil\/scene-graph\//, /^node:/], onlyBundle: false }, outputOptions: { minifyInternalExports: false, codeSplitting: { groups: [ { test: /(? { const cleanId = id.split('?')[0] const parts = cleanId.split(/[\\/]/g) const srcIndex = parts.lastIndexOf('src') const file = srcIndex >= 0 ? parts.slice(srcIndex + 1).join('/') : parts.at(-1) ?? 'chunk' return `chunks/${file.replace(/\.(ts|tsx)$/, '')}` } } ] } } })