mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
extend system loader with moduleName support
This commit is contained in:
@@ -1,15 +1,22 @@
|
||||
const moduleIdRegex = /moduleId: module.id,/g;
|
||||
const moduleNameRegex = /moduleId: __moduleName,/g;
|
||||
|
||||
module.exports = function(source) {
|
||||
this.cacheable();
|
||||
|
||||
let result = source;
|
||||
let modified = false;
|
||||
|
||||
if (moduleIdRegex.test(source)) {
|
||||
result = source.replace(moduleIdRegex, (match) => {
|
||||
return `// ${match}`;
|
||||
});
|
||||
// console.log(result);
|
||||
}
|
||||
|
||||
if (moduleNameRegex.test(source)) {
|
||||
result = source.replace(moduleNameRegex, (match) => {
|
||||
return `// ${match}`;
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user