From ae430456f67af1c97a5676b790e50f54f681b2a2 Mon Sep 17 00:00:00 2001 From: Fovir Date: Sat, 23 May 2026 18:29:51 +0800 Subject: [PATCH] fix: prevent DOM elements with id="process" from hijacking environment detection --- task/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/task/build.js b/task/build.js index 888726cb..deb74600 100644 --- a/task/build.js +++ b/task/build.js @@ -438,7 +438,7 @@ else (async function(){ build = build.replace(/\(([a-z])=([a-z]).config\)&&\(([a-z])=([a-z])\)/, "($1=$2.config)&&($3=(await import($4))[\"default\"])"); if(options["SUPPORT_WORKER"]){ - build = build.replace("(function(self){'use strict';", "(function _f(self){'use strict';if(typeof module!=='undefined')self=module;else if(typeof process !== 'undefined')self=process;self._factory=_f;"); + build = build.replace("(function(self){'use strict';", "(function _f(self){'use strict';if(typeof module!=='undefined')self=module;else if(typeof process !== 'undefined' && typeof process.env !== 'undefined')self=process;self._factory=_f;"); //build = build.replace("(function(self){", "(function _f(self){if(typeof module!=='undefined')self=module;else if(typeof process !== 'undefined')self=process;self._factory=_f;"); }