Enhancement
Problem
The build script runs both:
tsup (JS bundles + DTS)
vite build in library mode
This can generate duplicate or unclear build artifacts.
Impact
- Larger and potentially confusing
dist/ output.
- Harder to maintain and reason about published bundles.
- Risk of mismatched entrypoints over time.
Location
package.json → scripts.build
tsup.config.ts
vite.config.ts
Suggested Improvement
Pick a single build strategy:
Option A
- Use
tsup for JS + type declarations.
- Copy CSS assets manually.
- Remove
vite build from the library build step.
Option B
- Use Vite library mode exclusively.
- Ensure it outputs both ESM and CJS if required.
- Align
exports with Vite’s output.
Enhancement
Problem
The
buildscript runs both:tsup(JS bundles + DTS)vite buildin library modeThis can generate duplicate or unclear build artifacts.
Impact
dist/output.Location
package.json→scripts.buildtsup.config.tsvite.config.tsSuggested Improvement
Pick a single build strategy:
Option A
tsupfor JS + type declarations.vite buildfrom the library build step.Option B
exportswith Vite’s output.