Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 21bd32f

Browse files
authored
chore: make moduleId loader work with karma (#3499)
1 parent 918ae99 commit 21bd32f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

public/docs/_examples/_boilerplate/src/systemjs-angular-loader.js

Lines changed: 5 additions & 1 deletion
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)