Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 87ad8f5

Browse files
feelingsofwhiteFoxandxss
authored andcommitted
chore: fix systemjs-angular-loader.js for external templates (#444) (#445)
1 parent 418dc2e commit 87ad8f5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/systemjs-angular-loader.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ var stylesRegex = /styleUrls *:(\s*\[[^\]]*?\])/g;
33
var stringRegex = /(['`"])((?:[^\\]\\\1|.)*?)\1/g;
44

55
module.exports.translate = function(load){
6+
if (load.source.indexOf('moduleId') != -1) return load;
7+
68
var url = document.createElement('a');
79
url.href = load.address;
810

@@ -15,7 +17,9 @@ module.exports.translate = function(load){
1517
baseHref.href = this.baseURL;
1618
baseHref = baseHref.pathname;
1719

18-
basePath = basePath.replace(baseHref, '');
20+
if (!baseHref.startsWith('/base/')) { // it is not karma
21+
basePath = basePath.replace(baseHref, '');
22+
}
1923

2024
load.source = load.source
2125
.replace(templateUrlRegex, function(match, quote, url){

0 commit comments

Comments
 (0)