-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
23 lines (22 loc) · 1.04 KB
/
Copy pathtsup.config.ts
File metadata and controls
23 lines (22 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { defineConfig } from 'tsup'
// Per-file (unbundled) ESM output. Each source module compiles to its own
// dist file so the 'use client' boundary survives per component: RSC-authored
// components stay server components for consumers, and bundlers can tree-shake
// through the barrel (sideEffects in package.json covers the rest).
//
// Heavy plugins (apexcharts, flatpickr, jsvectormap, quill, sortablejs,
// tabulator-tables, tom-select) are loaded via dynamic import() inside effects;
// in unbundled output those specifiers stay as written and resolve from the
// consumer's node_modules (declared as optional peer dependencies).
//
// fix-dist.js post-processes the output: re-applies 'use client' directives
// (esbuild strips them) and makes relative imports fully specified (.js) so
// the output works under webpack's ESM fullySpecified resolution.
export default defineConfig({
entry: ['src/**/*.ts', 'src/**/*.tsx', '!src/**/*.test.*'],
format: ['esm'],
bundle: false,
dts: { entry: 'src/index.ts' },
sourcemap: false,
clean: true,
})