From e5132eff2fd1cdeeef35a68f35546a53791e29b4 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Fri, 21 Apr 2023 14:44:35 +0100 Subject: [PATCH] MDL-77995 javascript: more precise path matching building JS. --- .grunt/tasks/javascript.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.grunt/tasks/javascript.js b/.grunt/tasks/javascript.js index b22abaa73b1..faf5223054e 100644 --- a/.grunt/tasks/javascript.js +++ b/.grunt/tasks/javascript.js @@ -30,10 +30,10 @@ * @param {String} srcPath the matched src path * @return {String} The rewritten destination path. */ - const babelRename = function(destPath, srcPath) { - destPath = srcPath.replace('src', 'build'); - destPath = destPath.replace('.js', '.min.js'); + const path = require('path'); + destPath = srcPath.replace(`amd${path.sep}src`, `amd${path.sep}build`); + destPath = destPath.replace(/\.js$/, '.min.js'); return destPath; };