chore(build): fix esbuild bundle warnings and externals#40155
Merged
pavelfeldman merged 3 commits intomicrosoft:mainfrom Apr 10, 2026
Merged
chore(build): fix esbuild bundle warnings and externals#40155pavelfeldman merged 3 commits intomicrosoft:mainfrom
pavelfeldman merged 3 commits intomicrosoft:mainfrom
Conversation
- Suppress direct-eval warnings for all bundled steps (Playwright intentionally uses eval in evaluate() callbacks sent to browser) - Add 'playwright' to babelBundle externals (require.resolve at runtime) - Add '../transform/esmLoader.js' to common/runner/worker bundle externals (require.resolve for ESM loader registration) - Fix babelBundle.ts importSource to use bare 'playwright' specifier - Remove unused WebSocketEventEmitter type alias in browserServerImpl
yury-s
approved these changes
Apr 10, 2026
This comment has been minimized.
This comment has been minimized.
The bare 'playwright' specifier breaks under pnpm's strict
node_modules — transitive deps aren't hoisted, so user test
files can't resolve 'playwright/jsx-runtime'. Revert to
path.dirname(require.resolve('playwright')) which gives an
absolute path that always resolves.
Suppress the resulting require-resolve-not-external warning
in the babelBundle step since 'playwright' is already external.
This comment has been minimized.
This comment has been minimized.
Instead of babelBundle.ts doing require.resolve('playwright')
(which creates a bundling dependency on the 'playwright' package),
pass the resolved path through TransformConfig.jsxImportSource.
configLoader.ts resolves it once at config load time and passes
it through the existing transform config pipeline.
Contributor
Test results for "MCP"6481 passed, 383 skipped Merge workflow run. |
Contributor
Test results for "tests 1"1 failed 4 flaky39096 passed, 846 skipped Merge workflow run. |
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
direct-evalwarnings for all bundled esbuild steps (Playwright uses eval in evaluate() callbacks stringified for the browser)'playwright'for babelBundle,'../transform/esmLoader.js'for common/runner/worker bundlesbabelBundle.tsJSXimportSourceto use bare'playwright'specifier instead ofpath.dirname(require.resolve('playwright'))WebSocketEventEmittertype alias inbrowserServerImpl.ts