Skip to content

fix(build): override rollup-plugin-typescript2 for picomatch compatibility - #361

Open
hasanefeuygun wants to merge 1 commit into
gvergnaud:mainfrom
hasanefeuygun:fix/picomatch-build-compat
Open

fix(build): override rollup-plugin-typescript2 for picomatch compatibility#361
hasanefeuygun wants to merge 1 commit into
gvergnaud:mainfrom
hasanefeuygun:fix/picomatch-build-compat

Conversation

@hasanefeuygun

@hasanefeuygun hasanefeuygun commented Aug 5, 2026

Copy link
Copy Markdown

Summary

Override Microbundle's rollup-plugin-typescript2 dependency to version 0.37.0.

This restores the build on the current main branch after the upgrade to picomatch@2.3.2.

Root cause

microbundle@0.15.1 uses an older version of rollup-plugin-typescript2.

That version uses the following default include patterns for TypeScript files:

*.ts+(|x)
**/*.ts+(|x)

After the upgrade to picomatch@2.3.2, these patterns no longer match plain .ts files.

As a result:

  1. rollup-plugin-typescript2 skips plain .ts source files.
  2. TypeScript syntax is not transformed into JavaScript.
  3. The untransformed source reaches Babel.
  4. Babel fails while parsing statements such as export type.

rollup-plugin-typescript2@0.37.0 uses the compatible patterns:

*.ts{,x}
**/*.ts{,x}

Changes

Added a scoped npm override so that only Microbundle's rollup-plugin-typescript2 dependency is replaced:

"overrides": {
  "microbundle": {
    ".": "$microbundle",
    "rollup-plugin-typescript2": "0.37.0"
  }
}

The Microbundle version itself remains unchanged.

Bisect result

git bisect identified the first bad commit as:

8d4b56c8fb4f04e0a33be7679a9f8b15e9e2dcfe
build(deps): bump picomatch

The parent commit builds successfully in the same environment.

Verification

Verified from a clean installation:

rm -rf node_modules dist
npm ci
npm run build

Additional checks:

  • npm run check
  • npm test — 48 test suites and 453 tests passed
  • git diff --check

The build successfully generated the expected CJS, ESM, and UMD bundles.

Fixes #360


Summary by cubic

Restore the build after upgrading to picomatch@2.3.2 by overriding microbundle’s rollup-plugin-typescript2 to 0.37.0, ensuring .ts files are correctly matched and transpiled.

  • Bug Fixes
    • Root cause: microbundle@0.15.1 depended on rollup-plugin-typescript2@0.32.x which used *.ts+(|x) patterns that no longer match in picomatch@2.3.2, so .ts files were skipped and Babel failed.
    • Fix: Added an npm overrides block to pin only microbundle’s rollup-plugin-typescript2 to 0.37.0 (uses *.ts{,x}); microbundle itself is unchanged.
    • Result: Build succeeds and outputs CJS/ESM/UMD bundles; tests pass.

Written for commit 9ff1337. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 2 files

Re-trigger cubic

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.

Build fails on main after picomatch 2.3.2 upgrade

1 participant