Skip to content

Migrate build system from Vite to tsdown#25

Merged
bartveneman merged 5 commits intomainfrom
claude/replace-vite-tsdown-d4bai
Mar 8, 2026
Merged

Migrate build system from Vite to tsdown#25
bartveneman merged 5 commits intomainfrom
claude/replace-vite-tsdown-d4bai

Conversation

@bartveneman
Copy link
Member

Summary

This PR migrates the project's build system from Vite to tsdown, simplifying the build configuration and tooling while maintaining the same output format and functionality.

Key Changes

  • Removed Vite configuration: Deleted vite.config.js and all Vite-specific build setup
  • Added tsdown configuration: Created tsdown.config.js with integrated DTS generation, publint validation, and Codecov bundle analysis
  • Updated build script: Changed from vite build to tsdown in package.json
  • Updated entry points: Modified export paths from ./dist/css-layer-tree.js to ./dist/index.mjs and types from ./dist/index.d.ts to ./dist/index.d.mts
  • Replaced dependencies:
    • Removed: vite, vite-plugin-dts, @codecov/vite-plugin, publint
    • Added: tsdown, @codecov/rollup-plugin
  • Removed lint-package CI job: Eliminated the separate package linting workflow step as publint validation is now integrated into the build process via tsdown

Implementation Details

  • tsdown provides built-in TypeScript-to-JavaScript transpilation with DTS generation, eliminating the need for separate Vite and vite-plugin-dts dependencies
  • The Codecov plugin was switched from the Vite variant to the Rollup variant, which tsdown uses under the hood
  • Package validation (publint) is now part of the build process rather than a separate CI step, improving developer experience

https://claude.ai/code/session_01JJJhv1D5c6sE4e4L9AJZ5x

claude added 3 commits March 8, 2026 12:03
- Add tsdown.config.js with dts and publint enabled
- Remove vite.config.js, vite, vite-plugin-dts, @codecov/vite-plugin, publint deps
- Update build script from `vite build` to `tsdown`
- Remove lint-package script and lint-package CI job (publint now runs as part of build)
- Update package.json exports/main/types to match tsdown default .mjs/.d.mts output

https://claude.ai/code/session_01JJJhv1D5c6sE4e4L9AJZ5x
Replace @codecov/vite-plugin with @codecov/rollup-plugin in tsdown config.
Restore CODECOV_TOKEN env var in the build CI step.

https://claude.ai/code/session_01JJJhv1D5c6sE4e4L9AJZ5x
Resolves high severity rollup path traversal (GHSA-mw96-cpmx-2vgc)
and moderate esbuild dev server issue (GHSA-67mh-4wv8-2f99).
Remaining 3 moderate undici issues are unfixable upstream in
@codecov/rollup-plugin's transitive deps.

https://claude.ai/code/session_01JJJhv1D5c6sE4e4L9AJZ5x
@codecov-commenter
Copy link

Bundle Report

Changes will decrease total bundle size by 4.86kB (-52.79%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
cssLayerTree-esm 4.35kB 757 bytes (21.09%) ⬆️
cssLayerTree-cssLayerTree-esm (removed) -3.13kB (-100.0%) ⬇️
cssLayerTree-cssLayerTree-esm-cssLayerTree-umd (removed) -2.49kB (-100.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: cssLayerTree-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.mjs (New) 3.82kB 3.82kB 100.0% 🚀
index.d.mts (New) 523 bytes 523 bytes 100.0% 🚀
css-*.js (Deleted) -3.59kB 0 bytes -100.0% 🗑️

@bartveneman bartveneman merged commit cb4558c into main Mar 8, 2026
5 checks passed
@bartveneman bartveneman deleted the claude/replace-vite-tsdown-d4bai branch March 8, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants