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