This repository was archived by the owner on Feb 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,12 @@ var styleRegex = /styles\s*:(\s*\[[\s\S]*?\])/g;
4747var stringRegex = / ( [ ' " ] ) ( (?: [ ^ \\ ] \\ \1| .) * ?) \1/ g;
4848var selectorRegex = / s e l e c t o r \s * : \s * ( ' | " ) ( .* ) ( ' | " ) , ? / ;
4949
50+ var relativePathStart = '.' + path . sep ;
51+
5052function replaceStringsWithRequires ( string ) {
5153return string . replace ( stringRegex , function ( match , quote , url ) {
5254if ( url . charAt ( 0 ) !== '.' ) {
53- url = './' + url ;
55+ url = relativePathStart + url ;
5456}
5557return "require('" + url + "')" ;
5658} ) ;
@@ -136,7 +138,7 @@ function Angular2ConventionsLoader(source, sourcemap){
136138} catch ( e ) { }
137139} else {
138140try {
139- _hasHtmlFile = fs . statSync ( path . join ( self . context , './' + __selector + htmlExtension ) ) ;
141+ _hasHtmlFile = fs . statSync ( path . join ( self . context , relativePathStart + __selector + htmlExtension ) ) ;
140142} catch ( e ) {
141143metadata = 'template: "",' + metadata ;
142144}
@@ -153,7 +155,7 @@ function Angular2ConventionsLoader(source, sourcemap){
153155} catch ( e ) { }
154156} else {
155157try {
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
You can’t perform that action at this time.
0 commit comments