In Stylus resolve relative paths with path.join

This commit is contained in:
Slava Kim
2015-07-24 11:33:10 -07:00
parent 97060c1941
commit 7e8de86bba

View File

@@ -63,9 +63,15 @@ class StylusCompiler extends MultiFileCachingCompiler {
// relative path in the same package
const parsedImporter = parseImportPath(importerPath, null);
// resolve path if it is absolute or relative
const importPath =
(filePath[0] === '/') ? filePath :
path.join(path.dirname(parsedImporter.pathInPackage), filePath);
return {
packageName: parsedImporter.packageName,
pathInPackage: path.resolve(parsedImporter.pathInPackage, filePath)
pathInPackage: importPath
};
}