MDL-77995 javascript: more precise path matching building JS.

This commit is contained in:
Paul Holden 2023-04-21 14:44:35 +01:00
parent 017a3274fe
commit e5132eff2f
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164

View File

@ -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;
};