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

Commit 40c02ab

Browse files
committed
chore: wip windows path
1 parent efab87e commit 40c02ab

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎index.js‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ var styleRegex = /styles\s*:(\s*\[[\s\S]*?\])/g;
4747
varstringRegex=/(['"])((?:[^\\]\\\1|.)*?)\1/g;
4848
varselectorRegex=/selector\s*:\s*('|")(.*)('|"),?/;
4949

50+
varrelativePathStart='.'+path.sep;
51+
5052
functionreplaceStringsWithRequires(string){
5153
returnstring.replace(stringRegex,function(match,quote,url){
5254
if(url.charAt(0)!=='.'){
53-
url='./'+url;
55+
url=relativePathStart+url;
5456
}
5557
return"require('"+url+"')";
5658
});
@@ -136,7 +138,7 @@ function Angular2ConventionsLoader(source, sourcemap){
136138
}catch(e){}
137139
}else{
138140
try{
139-
_hasHtmlFile=fs.statSync(path.join(self.context,'./'+__selector+htmlExtension));
141+
_hasHtmlFile=fs.statSync(path.join(self.context,relativePathStart+__selector+htmlExtension));
140142
}catch(e){
141143
metadata='template: "",'+metadata;
142144
}
@@ -153,7 +155,7 @@ function Angular2ConventionsLoader(source, sourcemap){
153155
}catch(e){}
154156
}else{
155157
try{
156-
_hasCssFile=fs.statSync(path.join(self.context,'./'+__selector+cssExtension));
158+
_hasCssFile=fs.statSync(path.join(self.context,relativePathStart+__selector+cssExtension));
157159
}catch(e){}
158160
}
159161

0 commit comments

Comments
(0)