From 243060b310629da4a96e0702f7c5b9e3fced81de Mon Sep 17 00:00:00 2001 From: Igor Savin Date: Thu, 19 Mar 2026 00:18:43 +0200 Subject: [PATCH] Fix CI --- lib/handlebars/compiler/code-gen.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/handlebars/compiler/code-gen.js b/lib/handlebars/compiler/code-gen.js index fedfeeeb..142425ea 100644 --- a/lib/handlebars/compiler/code-gen.js +++ b/lib/handlebars/compiler/code-gen.js @@ -8,7 +8,12 @@ try { if (typeof define !== 'function' || !define.amd) { // We don't support this in AMD environments. For these environments, we assume that // they are running on the browser and thus have no need for the source-map library. - let SourceMap = require('source-map'); + // The variable indirection prevents bundlers from statically resolving and bundling + // source-map (which requires Node-built-ins). The stub SourceNode below handles + // browser/bundled usage. Bundlers may emit a "Critical dependency" warning — this + // is expected and harmless. + let mod = 'source-map'; + let SourceMap = require(mod); SourceNode = SourceMap.SourceNode; } // oxlint-disable-next-line no-unused-vars -- Babel 5 requires named catch param