Skip to content

Conversation

@s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Jan 16, 2026

Fixes a regression introduced by PR #830 where debug IDs were not being injected into SPA main bundles. The original fix for issue #829 skipped all chunks with HTML facades to prevent creating unnecessary modules in Vite MPA builds. However, in SPAs, the main entry bundle also has an HTML facade but contains actual application code that needs debug ID injection.

This change adds a containsOnlyImports helper that checks whether a chunk's code is purely import/export statements. Now, HTML facade chunks are only skipped if they contain just imports (true MPA facades), while chunks with substantial code (SPA main bundles) get debug IDs injected as expected.

While the previous fix for #829 already added test cases, I also tested this locally with the reproduction example shared in the issue description. It still works as expected.

Closes #839

@s1gr1d s1gr1d requested review from Lms24 and logaretm January 16, 2026 13:27
@github-actions
Copy link

github-actions bot commented Jan 16, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Bug Fixes 🐛

Plugin Manager

  • Respect sourcemap.ignore values for injecting debugIDs by s1gr1d in #836
  • Enable "rejectOnError" in debug by s1gr1d in #837

Other

  • (vite) Skip HTML injection for MPA but keep it for SPA by s1gr1d in #843

Documentation 📚

  • Add RELEASE.md to document release process by nicohrubec in #834

Build / dependencies / internal 🔧

  • (release) Switch from action-prepare-release to Craft by BYK in #831

🤖 This preview updates automatically when you update the PR.

Copy link
Collaborator

@logaretm logaretm left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this, good one!

@s1gr1d s1gr1d merged commit e6eaece into main Jan 16, 2026
25 checks passed
@s1gr1d s1gr1d deleted the sig/fix-html-injection branch January 16, 2026 15:18
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.

Debug ID injection skipped for main SPA bundle (HTML facade chunk) in Vite

4 participants