-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtsup.config.ts
More file actions
31 lines (30 loc) · 972 Bytes
/
Copy pathtsup.config.ts
File metadata and controls
31 lines (30 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { defineConfig } from 'tsup';
import { copyFileSync } from 'fs';
export default defineConfig({
entry: ['src/index.ts'],
format: ['cjs', 'esm'],
dts: { resolve: true },
splitting: false,
sourcemap: false,
clean: true,
minify: false,
treeshake: true,
external: ['react', 'react-dom', 'next'],
// No CSS modules — plain CSS exported separately
async onSuccess() {
try {
copyFileSync('src/styles/mandoo.css', 'dist/styles.css');
console.log('✓ dist/styles.css ready');
} catch (e) {
console.warn('CSS copy failed:', e);
}
try {
const { writeFileSync } = await import('fs');
writeFileSync('dist/styles.d.ts', '// side-effect import — no exports\nexport {};\n');
writeFileSync('dist/styles.d.mts', '// side-effect import — no exports\nexport {};\n');
console.log('✓ dist/styles.d.ts ready');
} catch (e) {
console.warn('styles.d.ts creation failed:', e);
}
},
});