refactor: extract shared config logic from sauce.config.cjs/mjs#316
Open
anupam-sl wants to merge 2 commits into
Open
refactor: extract shared config logic from sauce.config.cjs/mjs#316anupam-sl wants to merge 2 commits into
anupam-sl wants to merge 2 commits into
Conversation
Playwright resolves project config by replacing root-level `use` properties with project-level ones. When a project defines its own `use.contextOptions` (e.g. reducedMotion), it completely overrides the root-level contextOptions — losing the SC tunnel proxy settings and causing scripted requests to fail with ENOTFOUND. This iterates over user-defined projects and merges proxy settings into each project's contextOptions so both coexist. Fixes INT-11 Co-Authored-By: Claude Opus 4.6 <[email protected]>
The CJS and MJS entrypoints were ~95% identical, differing only in import/export syntax and config loading (require vs await import). This extracts the shared merge logic into sauce-config-shared.cjs so changes only need to be made once. The shared module is CJS so both entrypoints can consume it (ESM can import CJS). This loses tree-shaking, but it's irrelevant since these are small config files running in Node.js at build time.
77f6bbf to
a2acba2
Compare
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
requirevsawait import)sauce-config-shared.cjsso changes only need to be made oncecontextOptions: {}in the initial overridesNote: This PR is based on
fix/merge-project-level-context-options(#315) — merge that first