From 62d7abcb72c7fc5dc3271cf10e1a1d9811786f22 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Thu, 8 Dec 2016 15:51:46 +0000 Subject: [PATCH] extend system loader with moduleName support --- demo-shell-ng2/config/loaders/system.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/demo-shell-ng2/config/loaders/system.js b/demo-shell-ng2/config/loaders/system.js index 2775093851..836b205604 100644 --- a/demo-shell-ng2/config/loaders/system.js +++ b/demo-shell-ng2/config/loaders/system.js @@ -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; }