fix: add esbuild bundling guard and tests to prevent react-email regression#225
Merged
felipefreitag merged 2 commits intomainfrom Apr 16, 2026
Merged
fix: add esbuild bundling guard and tests to prevent react-email regression#225felipefreitag merged 2 commits intomainfrom
felipefreitag merged 2 commits intomainfrom
Conversation
Member
Author
|
@cubic-dev-ai can you review? |
Contributor
@bukinoshita I have started the AI code review. It will take a few minutes to complete. |
64d43c7 to
3884e71
Compare
…ession
- Add two checks to verify-bundle.mjs: detect inlined esbuild guard
string and verify external require('esbuild') is present in bundle
- Add unit tests for bundleReactEmail (mocking esbuild at boundary)
- Add tests for verify-bundle script covering all validation paths
Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>
- verify-bundle.mjs accepts optional CLI path arg so tests don't overwrite dist/cli.cjs; adds esbuild-wasm external require check - Extract loadEsbuild to its own module for testability - Verify-bundle tests use temp files instead of mutating dist/ - React-email-bundler test actually asserts tmpDir cleanup on failure
3884e71 to
ff175c8
Compare
felipefreitag
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by cubic
Adds prepack bundle guards and tests to ensure
esbuildstays external and is never inlined. Follow-up to BU-610 to prevent React email bundling regressions.scripts/verify-bundle.mjs: fail if the inlinedesbuildmarker is found or ifrequire("esbuild")is missing fromdist/cli.cjs.bundleReactEmailand the verify script: verify build options, tmp cleanup on failure, and all validation paths (PostHog key, inlined marker, missing external require, happy path).Written for commit 203ab0a. Summary will update on new commits.