diff --git a/packages/stylus/plugin/compile-stylus.js b/packages/stylus/plugin/compile-stylus.js index f2c22b53c7..dc74e237e7 100644 --- a/packages/stylus/plugin/compile-stylus.js +++ b/packages/stylus/plugin/compile-stylus.js @@ -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 }; }