From bc74e404b68d15543df335e5da40f75fe9c0d6cc Mon Sep 17 00:00:00 2001 From: Enrique Marroquin <5449100+Enriqe@users.noreply.github.com> Date: Wed, 13 May 2020 11:52:26 -0400 Subject: [PATCH] Fix check for unknown deps regex (#28366) * fix regex * Small updates Co-authored-by: Justin Ridgewell --- build-system/compile/check-for-unknown-deps.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build-system/compile/check-for-unknown-deps.js b/build-system/compile/check-for-unknown-deps.js index 3d2a015fd1d0..1ded914341c3 100644 --- a/build-system/compile/check-for-unknown-deps.js +++ b/build-system/compile/check-for-unknown-deps.js @@ -20,24 +20,24 @@ const through = require('through2'); const {red, cyan, yellow} = require('ansi-colors'); /** - * Searches for the identifier "$$module$", which Closure uses to uniquely + * Searches for the identifier "module$", which Closure uses to uniquely * reference module imports. If any are found, that means Closure couldn't * import the module correctly. * * @return {!Stream} */ exports.checkForUnknownDeps = function () { - const regex = /[\w$]+?\$\$module\$[\w$]+/; + const regex = /[\w$]*module\$[\w$]+/; return through.obj(function (file, encoding, cb) { const contents = file.contents.toString(); - if (!contents.includes('$$module$')) { + if (!contents.includes('module$')) { // Fast check, since regexes can backtrack like crazy. return cb(null, file); } const match = regex.exec(contents) || [ - `couldn't parse the dep. Look for "$$module$" in the file`, + `couldn't parse the dep. Look for "module$" in the file`, ]; log(