Joel
Joel

Reputation: 119

Visual Studio 2015 Sass intellisense for absolute paths

I'm having some issues with getting the intellisense for imported variables to work in sass-files in VS 2015.

I have some global sass-files in /Static/Styles/ that I'm importing from various files in /Components/ to access the global variables.

I got the compilation working by setting the value includePath in compilerconfig to "Static/Styles/" but the intellisense won't pick up the variables in these files.

I have tried referencing the files with "< reference path.../>" but no luck there either. The only thing that works is importing the files with a relative path but this is of course far from ideal.

@import "/Styles/Static/_settings.global.scss"; //Doesn't work
@import "_settings.global.scss"; //Compiles but no intellisense
@import "../../../../Static/Styles/_settings.global.scss"; //Compiles and intellisense works

Is there any way to get the intellisense to work with absolute paths?

Upvotes: 2

Views: 652

Answers (1)

Jack Zhai
Jack Zhai

Reputation: 6436

It really has a limitation, other community members also asked the similar issue before, the workaround is that you could think about using the Resolve URL Loader: https://github.com/jtangelder/sass-loader.

Other similar issues:

How to use absolute path to import custom scss, when using react + webpack?

SASS: Import a file from a different directory?

Upvotes: 1

Related Questions