chore: fix moduleId loader on plunkers (#3393)
This commit is contained in:
parent
d231f82b4a
commit
7906d4fadf
@ -8,13 +8,13 @@ module.exports.translate = function(load){
|
|||||||
|
|
||||||
var basePathParts = url.pathname.split('/');
|
var basePathParts = url.pathname.split('/');
|
||||||
|
|
||||||
if (url.href.indexOf('plnkr') != -1) {
|
|
||||||
basePathParts.shift();
|
|
||||||
basePathParts.shift();
|
|
||||||
}
|
|
||||||
|
|
||||||
basePathParts.pop();
|
basePathParts.pop();
|
||||||
var basePath = basePathParts.join('/');
|
var basePath = basePathParts.join('/');
|
||||||
|
|
||||||
|
var baseHref = new URL(this.baseURL).pathname;
|
||||||
|
|
||||||
|
basePath = basePath.replace(baseHref, '');
|
||||||
|
|
||||||
load.source = load.source
|
load.source = load.source
|
||||||
.replace(templateUrlRegex, function(match, quote, url){
|
.replace(templateUrlRegex, function(match, quote, url){
|
||||||
let resolvedUrl = url;
|
let resolvedUrl = url;
|
||||||
@ -30,7 +30,7 @@ module.exports.translate = function(load){
|
|||||||
|
|
||||||
while ((match = stringRegex.exec(relativeUrls)) !== null) {
|
while ((match = stringRegex.exec(relativeUrls)) !== null) {
|
||||||
if (match[2].startsWith('.')) {
|
if (match[2].startsWith('.')) {
|
||||||
urls.push(`'${basePath.substr(1)}${match[2].substr(1)}'`);
|
urls.push(`'${basePath}${match[2].substr(1)}'`);
|
||||||
} else {
|
} else {
|
||||||
urls.push(`'${match[2]}'`);
|
urls.push(`'${match[2]}'`);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
},
|
},
|
||||||
// map tells the System loader where to look for things
|
// map tells the System loader where to look for things
|
||||||
map: {
|
map: {
|
||||||
'ng-loader': './systemjs-angular-loader.js',
|
|
||||||
// our app is within the app folder
|
// our app is within the app folder
|
||||||
'app': 'app',
|
'app': 'app',
|
||||||
|
|
||||||
@ -75,7 +74,7 @@
|
|||||||
defaultExtension: 'ts',
|
defaultExtension: 'ts',
|
||||||
meta: {
|
meta: {
|
||||||
'./*.ts': {
|
'./*.ts': {
|
||||||
loader: 'ng-loader'
|
loader: 'systemjs-angular-loader.js'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
},
|
},
|
||||||
// map tells the System loader where to look for things
|
// map tells the System loader where to look for things
|
||||||
map: {
|
map: {
|
||||||
'ng-loader': './systemjs-angular-loader.js',
|
|
||||||
// our app is within the app folder
|
// our app is within the app folder
|
||||||
'app': 'app',
|
'app': 'app',
|
||||||
|
|
||||||
@ -62,7 +61,7 @@
|
|||||||
defaultExtension: 'ts',
|
defaultExtension: 'ts',
|
||||||
meta: {
|
meta: {
|
||||||
'./*.ts': {
|
'./*.ts': {
|
||||||
loader: 'ng-loader'
|
loader: 'systemjs-angular-loader.js'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user