chore: fix moduleId loader on plunkers (#3393)

This commit is contained in:
Jesús Rodríguez 2017-03-20 18:40:03 +01:00 committed by GitHub
parent d231f82b4a
commit 7906d4fadf
3 changed files with 8 additions and 10 deletions

View File

@ -8,13 +8,13 @@ module.exports.translate = function(load){
var basePathParts = url.pathname.split('/');
if (url.href.indexOf('plnkr') != -1) {
basePathParts.shift();
basePathParts.shift();
}
basePathParts.pop();
var basePath = basePathParts.join('/');
var baseHref = new URL(this.baseURL).pathname;
basePath = basePath.replace(baseHref, '');
load.source = load.source
.replace(templateUrlRegex, function(match, quote, url){
let resolvedUrl = url;
@ -30,7 +30,7 @@ module.exports.translate = function(load){
while ((match = stringRegex.exec(relativeUrls)) !== null) {
if (match[2].startsWith('.')) {
urls.push(`'${basePath.substr(1)}${match[2].substr(1)}'`);
urls.push(`'${basePath}${match[2].substr(1)}'`);
} else {
urls.push(`'${match[2]}'`);
}

View File

@ -34,7 +34,6 @@
},
// map tells the System loader where to look for things
map: {
'ng-loader': './systemjs-angular-loader.js',
// our app is within the app folder
'app': 'app',
@ -75,7 +74,7 @@
defaultExtension: 'ts',
meta: {
'./*.ts': {
loader: 'ng-loader'
loader: 'systemjs-angular-loader.js'
}
}
},

View File

@ -31,7 +31,6 @@
},
// map tells the System loader where to look for things
map: {
'ng-loader': './systemjs-angular-loader.js',
// our app is within the app folder
'app': 'app',
@ -62,7 +61,7 @@
defaultExtension: 'ts',
meta: {
'./*.ts': {
loader: 'ng-loader'
loader: 'systemjs-angular-loader.js'
}
}
},