Skip to content
18 changes: 16 additions & 2 deletions packages/vue-sass/vue-sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,22 @@ function discoverImportPath (importPath) {
}

for (let i = 0, potentialPath = potentialPaths[i]; i < potentialPaths.length; i++, potentialPath = potentialPaths[i]) {
if (fs.existsSync(potentialPaths[i]) && fs.lstatSync(potentialPaths[i]).isFile()) {
return potentialPath
if(fs.existsSync(potentialPath)) {
const stat = fs.lstatSync(potentialPath);

// if path is an symlink, check if the symlink points to a file
if(stat.isSymbolicLink()) {
try {
const realPath = fs.realpathSync(potentialPath);
if(fs.lstatSync(realPath).isFile()) {
return potentialPath;
}
} catch (e) {
// ignore errors
}
} else if(stat.isFile()) {
return potentialPath;
}
}
}

Expand Down