From 751611f690e452f81fe6551617cfb0ee02017503 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 16 Feb 2024 11:35:41 +0100 Subject: [PATCH] Remove unneeded `tweakWebpackOutput` usage in the gulpfile (PR 17637 follow-up) After the changes in PR 17637 there's no longer any reason to invoke `tweakWebpackOutput` without an argument, since the `__non_webpack_import__` re-writing was moved into the Babel plugin. This way we can avoid a (little) bit of unnecessary parsing during building. --- gulpfile.mjs | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/gulpfile.mjs b/gulpfile.mjs index 2babd3d8242fe..e8866f4751394 100644 --- a/gulpfile.mjs +++ b/gulpfile.mjs @@ -419,14 +419,10 @@ function checkChromePreferencesFile(chromePrefsPath, webPrefs) { } function tweakWebpackOutput(jsName) { - const replacer = []; - - if (jsName) { - replacer.push( - " __webpack_exports__ = {};", - " __webpack_exports__ = await __webpack_exports__;" - ); - } + const replacer = [ + " __webpack_exports__ = {};", + " __webpack_exports__ = await __webpack_exports__;", + ]; const regex = new RegExp(`(${replacer.join("|")})`, "gm"); return replace(regex, match => { @@ -466,8 +462,7 @@ function createScriptingBundle(defines, extraOptions = undefined) { ); return gulp .src("./src/pdf.scripting.js") - .pipe(webpack2Stream(scriptingFileConfig)) - .pipe(tweakWebpackOutput()); + .pipe(webpack2Stream(scriptingFileConfig)); } function createSandboxExternal(defines) { @@ -547,10 +542,7 @@ function createWebBundle(defines, options) { defaultPreferencesDir: options.defaultPreferencesDir, } ); - return gulp - .src("./web/viewer.js") - .pipe(webpack2Stream(viewerFileConfig)) - .pipe(tweakWebpackOutput()); + return gulp.src("./web/viewer.js").pipe(webpack2Stream(viewerFileConfig)); } function createGVWebBundle(defines, options) { @@ -568,8 +560,7 @@ function createGVWebBundle(defines, options) { ); return gulp .src("./web/viewer-geckoview.js") - .pipe(webpack2Stream(viewerFileConfig)) - .pipe(tweakWebpackOutput()); + .pipe(webpack2Stream(viewerFileConfig)); } function createComponentsBundle(defines) {