From e8f82bb7f1be1e6c3136a9c9a31f7398baa5ab2f Mon Sep 17 00:00:00 2001 From: Martin Probst Date: Fri, 11 Feb 2022 10:17:39 +0100 Subject: [PATCH] fix: support goog.module calls after comments `goog.module` calls may be preceded by block comments `/* foo */goog.module`. This change updates the heuristic regexp to handle that case. --- lib/googmodule.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/googmodule.js b/lib/googmodule.js index 88bb71a..01c9c59 100644 --- a/lib/googmodule.js +++ b/lib/googmodule.js @@ -1,7 +1,7 @@ var path = require('path'); // If the code has goog.module we need to wrap it. -var MODULE_REGEXP = /(^|;)\s*goog\.module\s*\(\s*['""]/m; +var MODULE_REGEXP = /(^|;|\*\/)\s*goog\.module\s*\(\s*['""]/m; // If the code already has goog.base no wrapper even if goog.module. var GOOGBASE_REGEXP = /^ \* @provideGoog *$/m;