From 88c42f788769fd736348f1d1a5a6812d130f2d8c Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 25 Oct 2024 16:20:33 -0700 Subject: [PATCH] chore: delete unused source-map-support code (#33306) --- packages/playwright/bundles/utils/build.js | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/packages/playwright/bundles/utils/build.js b/packages/playwright/bundles/utils/build.js index 8c6bd89cf2..6fca8d3e0a 100644 --- a/packages/playwright/bundles/utils/build.js +++ b/packages/playwright/bundles/utils/build.js @@ -16,35 +16,14 @@ // @ts-check const path = require('path'); -const fs = require('fs'); const esbuild = require('esbuild'); -// Can be removed once source-map-support was is fixed. -/** @type{import('esbuild').Plugin} */ -let patchSource = { - name: 'patch-source-map-support-deprecation', - setup(build) { - build.onResolve({ filter: /^source-map-support$/ }, () => { - const originalPath = require.resolve('source-map-support'); - const patchedPath = path.join(path.dirname(originalPath), path.basename(originalPath, '.js') + '.pw-patched.js'); - let sourceFileContent = fs.readFileSync(originalPath, 'utf8'); - // source-map-support is overwriting __PW_ZONE__ with func in core if source maps are present. - const original = `return state.nextPosition.name || originalFunctionName();`; - const insertedLine = `if (state.nextPosition.name === 'func') return originalFunctionName() || 'func';`; - sourceFileContent = sourceFileContent.replace(original, insertedLine + original); - fs.writeFileSync(patchedPath, sourceFileContent); - return { path: patchedPath } - }); - }, -}; - (async () => { const ctx = await esbuild.context({ entryPoints: [path.join(__dirname, 'src/utilsBundleImpl.ts')], external: ['fsevents'], bundle: true, outdir: path.join(__dirname, '../../lib'), - plugins: [patchSource], format: 'cjs', platform: 'node', target: 'ES2019',