openpencil/packages/scene-graph/tsdown.config.ts
Danila Poyarkov 91e759d7fd feat(editor): add configurable snapping and guides
- Snap vector points, moved layers, and resized edges to geometry, objects, guides, and pixels
- Add persistent snapping preferences with browser and native menu controls
- Normalize canvas and layout guides across Scene Graph and .fig conversion
- Clear transient snapping feedback across interrupted interactions
2026-08-18 19:11:48 +03:00

63 lines
1.7 KiB
TypeScript

import { defineConfig } from 'tsdown'
export default defineConfig({
entry: {
index: './src/index.ts',
copy: './src/copy.ts',
'node-defaults': './src/node-defaults.ts',
'hit-test': './src/hit-test.ts',
images: './src/images.ts',
instances: './src/instances.ts',
snap: './src/snap.ts',
'source-metadata': './src/source-metadata.ts',
preview: './src/preview.ts',
'text-picture': './src/text-picture.ts',
undo: './src/undo.ts',
variables: './src/variables.ts',
'variant-name': './src/variant-name.ts',
'vector-network': './src/vector-network.ts',
types: './src/types.ts',
primitives: './src/primitives.ts',
constants: './src/constants.ts',
coordinate: './src/coordinate.ts',
matrix: './src/matrix.ts',
geometry: './src/geometry.ts',
guides: './src/guides.ts',
'layout-guides': './src/layout-guides.ts',
resize: './src/resize.ts',
'parse-path': './src/parse-path.ts'
},
platform: 'neutral',
format: ['esm'],
dts: true,
sourcemap: true,
hash: false,
clean: true,
outDir: './dist',
treeshake: {
moduleSideEffects: false
},
deps: {
neverBundle: [/^node:/],
onlyBundle: false
},
outputOptions: {
minifyInternalExports: false,
codeSplitting: {
groups: [
{
test: /(?<!\.d\.c?ts)$/,
name: (id) => {
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)$/, '')}`
}
}
]
}
}
})