Skip to content

Commit

Permalink
Merge pull request #5 from rtsao/fix-relative-paths
Browse files Browse the repository at this point in the history
Fixed relative paths
  • Loading branch information
geelen committed Jun 9, 2015
2 parents eef3868 + bbcce9e commit 7f660e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/file-system-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ export default class FileSystemLoader {
let newPath = _newPath.replace( /^["']|["']$/g, "" ),
trace = _trace || String.fromCharCode( this.importNr++ )
return new Promise( ( resolve, reject ) => {
let rootRelativePath = path.resolve( path.dirname( relativeTo ), newPath ),
fileRelativePath = this.root + rootRelativePath
let relativeDir = path.dirname( relativeTo ),
rootRelativePath = path.resolve( relativeDir, newPath ),
fileRelativePath = path.resolve( path.join( this.root, relativeDir ), newPath )

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

0 comments on commit 7f660e7

Please sign in to comment.