This commit is contained in:
Mario Romano
2016-12-15 01:05:54 +00:00
parent e133fd6408
commit 04768f9798
34 changed files with 145 additions and 290 deletions

View File

@@ -1,22 +1,27 @@
const moduleIdRegex = /moduleId: module.id,/g;
const moduleNameRegex = /moduleId: __moduleName,/g;
const moduleIdPath = /module.id.replace/g;
module.exports = function(source) {
this.cacheable();
let result = source;
if (moduleIdRegex.test(source)) {
result = source.replace(moduleIdRegex, (match) => {
return `// ${match}`;
});
source = source.replace(moduleIdRegex, (match) => {
return `// ${match}`;
});
}
if (moduleNameRegex.test(source)) {
result = source.replace(moduleNameRegex, (match) => {
return `// ${match}`;
});
source = source.replace(moduleNameRegex, (match) => {
return `// ${match}`;
});
}
return result;
if (moduleIdPath.test(source)) {
source = source.replace(moduleIdPath, (match) => {
return `''.replace`;
});
}
return source;
}