Chrome DevTools for coding agents
fix(build): resolve node export conditions in rollup bundle (#2814)
Alex Rudenkod7c9b55490d0
diff --git a/rollup.config.js b/rollup.config.jsindex ac7b6298..b3a8e824 100644--- a/rollup.config.js+++ b/rollup.config.js@@ -293,8 +293,19 @@ const bundleDependency = (listBundledDeps(),commonjs(),json(),- nodeResolve(),+ nodeResolve({+ exportConditions: ['node'],+ preferBuiltins: true,+ }),],+ onwarn(warning, warn) {+ if (warning.code === 'UNRESOLVED_IMPORT') {+ throw new Error(+ `Unresolved import: ${warning.message}. All third-party dependencies must be bundled or explicitly marked as external.`,+ );+ }+ warn(warning);+ },external,});@@ -305,10 +316,19 @@ export default [inlineDynamicImports: true,},(source, importer, _isResolved) => {+ const normalizedImporter = importer?.replaceAll('\\', '/');if (source === 'yargs' &&- importer &&- importer.includes('puppeteer-core')+ normalizedImporter &&+ normalizedImporter.includes('puppeteer-core')+ ) {+ return true;+ }++ if (+ (source === 'proxy-agent' || source === 'yauzl') &&+ normalizedImporter &&+ normalizedImporter.includes('@puppeteer/browsers')) {return true;}diff --git a/tests/third_party_notices.test.js.snapshot b/tests/third_party_notices.test.js.snapshotindex cea6ee7a..bdc1dffc 100644--- a/tests/third_party_notices.test.js.snapshot+++ b/tests/third_party_notices.test.js.snapshot@@ -1155,6 +1155,36 @@ The above copyright notice and this permission notice shall be included in all cTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.+-------------------- DEPENDENCY DIVIDER --------------------++Name: pkce-challenge+URL: https://github.com/crouchcd/pkce-challenge#readme+Version: <VERSION>+License: MIT++MIT License++Copyright (c) 2019++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.++-------------------- DEPENDENCY DIVIDER --------------------Name: uri-js