Skip to content

fix: use plain imports for microbundle compat#85

Merged
JohnMcLear merged 2 commits intomainfrom
fix/babel-type-only-imports
Apr 7, 2026
Merged

fix: use plain imports for microbundle compat#85
JohnMcLear merged 2 commits intomainfrom
fix/babel-type-only-imports

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Summary

Follow-up to #84. The publish step still fails because microbundle's babel parser doesn't accept import type {Foo} syntax either. Use plain value imports — TypeScript treats them as type-only when the binding is used only in type position, and the bundler strips them.

Test plan

  • release / publish-npm step succeeds

🤖 Generated with Claude Code

JohnMcLear and others added 2 commits April 7, 2026 11:59
microbundle's babel parser doesn't accept 'import type' syntax either.
Use plain value imports — TypeScript treats them as type-only when the
binding is used only in type position, and the bundler strips them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The picomatch 2.3.1 -> 2.3.2 bump in PR #76 broke
rollup-plugin-typescript2's default include filter
['*.ts+(|x)', '**/*.ts+(|x)'] which uses the +(|x) extglob syntax.
picomatch 2.3.2 stopped matching this pattern, causing rpt2 to skip
all .ts files. Babel then sees raw TypeScript and chokes on 'as const'
and 'import type', breaking the publish-npm step.

Pin picomatch via npm overrides until rpt2 0.32+ updates its default
include pattern. Also add the previously-noted tsconfig fixes for
TypeScript 6 (rootDir + ignoreDeprecations) to silence rpt2 warnings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JohnMcLear JohnMcLear merged commit 68104d8 into main Apr 7, 2026
3 checks passed
@JohnMcLear JohnMcLear deleted the fix/babel-type-only-imports branch April 7, 2026 12:09
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.

1 participant