-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
34 lines (33 loc) · 815 Bytes
/
Copy pathtsup.config.ts
File metadata and controls
34 lines (33 loc) · 815 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
32
33
34
import { defineConfig } from "tsup";
export default defineConfig({
entry: {
index: "src/index.ts",
"components/index": "src/components/index.ts",
"utils/index": "src/utils/index.ts"
},
dts: {
resolve: true,
entry: ["src/index.ts", "src/components/index.ts", "src/utils/index.ts"]
},
format: ["esm", "cjs"],
sourcemap: true,
clean: true,
external: ["react", "react-dom"],
target: "es2019",
treeshake: true,
splitting: true,
minify: false,
// Incluir archivos CSS automáticamente
injectStyle: true,
esbuildOptions(options) {
options.banner = {
js: '"use client";',
};
// Configurar CSS para ser incluido en JS
options.loader = {
...options.loader,
'.css': 'css'
};
},
onSuccess: "echo 'Build completed successfully!'",
});