Skip to content

Microbundle to tsdown migration#886

Open
abetwothree wants to merge 9 commits into
tighten:2.xfrom
abetwothree:microbundle-to-tsdown-migration
Open

Microbundle to tsdown migration#886
abetwothree wants to merge 9 commits into
tighten:2.xfrom
abetwothree:microbundle-to-tsdown-migration

Conversation

@abetwothree

Copy link
Copy Markdown

This PR implements tsdown to address the vulnerability warnings associated with microbundler.

Functionally, it is the same as microbundler in how it bundles the files.

Long term, it will also allow for the current vanilla JS source files to be TypeScript and have tsdown convert to vanilla JS and generate .d.ts files automatically. That would remove the need for this command to exist ziggy:generate --types as types would be picked up automatically.

Thank you for your consideration 😄

Copilot AI review requested due to automatic review settings May 30, 2026 20:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR migrates the project’s bundling workflow from microbundle to tsdown, updates package entrypoints accordingly, and refreshes the generated dist/ outputs.

Changes:

  • Add tsdown build configurations for ESM + UMD builds and a separate npm-focused ESM build.
  • Update package.json scripts/entrypoints to use tsdown and remove microbundle.
  • Update TypeScript compiler settings and regenerate dist/ artifacts.

Reviewed changes

Copilot reviewed 3 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tsdown.config.ts Adds tsdown config for ESM + UMD builds, including dependency bundling rules.
tsdown.config.npm.ts Adds a separate tsdown config for npm publishing (ESM only).
tsconfig.json Enables skipLibCheck while keeping ESNext/Bundler settings.
package.json Switches build scripts to tsdown, updates exports/module fields, and updates dev dependencies.
dist/route.umd.js Updates the generated UMD bundle output.
dist/index.js Updates the generated ESM bundle output.
dist/index.esm.js Removes the previously generated ESM build file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment thread tsdown.config.ts Outdated
Comment thread tsdown.config.ts Outdated
@bakerkretzmar bakerkretzmar self-assigned this May 31, 2026
@bakerkretzmar

Copy link
Copy Markdown
Collaborator

Thanks! Why was exports.import added in package.json, what does that do exactly?

I removed a bunch of options that were set to their default values, and added back a shim index.esm.js in case people are importing that.

Going to continue testing.

@abetwothree

abetwothree commented Jun 26, 2026

Copy link
Copy Markdown
Author

@bakerkretzmar exports.import is for ESM support. exports.require is for common js support.

See the section about "Conditional exports" in the link below
https://nodejs.org/api/packages.html

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