-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
31 lines (29 loc) · 944 Bytes
/
tsup.config.ts
File metadata and controls
31 lines (29 loc) · 944 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"
/**
* CSS Bundling Note:
*
* The vanilla CSS files (LikeButton.vanilla.css, Particle.vanilla.css) are
* concatenated via scripts/build-css.js (cross-platform Node.js script).
*
* To add more CSS files, update the cssFiles array in scripts/build-css.js.
*
* If the project scales significantly, consider using postcss-import:
* 1. pnpm add -D postcss postcss-cli postcss-import cssnano
* 2. Create postcss.config.js with import and minification plugins
* 3. Create src/styles.css with: @import "./LikeButton/LikeButton.vanilla.css";
* 4. Update build: "tsup && postcss src/styles.css -o dist/styles.css"
*/
export default defineConfig({
entry: {
index: "src/index.ts",
vanilla: "src/vanilla.ts",
},
format: ["esm", "cjs"],
dts: true,
sourcemap: true,
clean: true,
external: ["react", "react-dom"],
esbuildOptions(options) {
options.jsx = "automatic"
},
})