Skip to content

Commit bbcce9e

Browse files
committed
Fixed relative paths
1 parent eef3868 commit bbcce9e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/file-system-loader.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ export default class FileSystemLoader {
3131
let newPath = _newPath.replace( /^["']|["']$/g, "" ),
3232
trace = _trace || String.fromCharCode( this.importNr++ )
3333
return new Promise( ( resolve, reject ) => {
34-
let rootRelativePath = path.resolve( path.dirname( relativeTo ), newPath ),
35-
fileRelativePath = this.root + rootRelativePath
34+
let relativeDir = path.dirname( relativeTo ),
35+
rootRelativePath = path.resolve( relativeDir, newPath ),
36+
fileRelativePath = path.resolve( path.join( this.root, relativeDir ), newPath )
3637

3738
fs.readFile( fileRelativePath, "utf-8", ( err, source ) => {
3839
if ( err ) reject( err )

0 commit comments

Comments
 (0)