johan-v-r / LibSassBuilder

Sass builder for .NET projects
MIT License
99 stars 14 forks source link

Support for include-path (or equivalent) parameter #37

Closed JayCallas closed 2 years ago

JayCallas commented 2 years ago

I have my own SCSS files that import from various packages found under node_modules. For example,

site.scss

...
@import 'bootstrap/scss/_variables';
@import 'bootstrap/scss/_mixins';
@import 'bootstrap/scss/_reboot';
...

When I currently execute npm run node-sass, I include the --include-path node_modules argument so the imports can be found. Does your LibSassBuilder tool have an equivalent option or do all imports need to be explicitly pathed?

johan-v-r commented 2 years ago

Hi - nope sorry no explicit include option. The default is to exclude 4 folders, which is basically this:

lsb --exclude 'node_modules bin obj logs'

So you could override that exclude to include your node_modules with this:

lsb --exclude 'bin obj logs'
johan-v-r commented 2 years ago

Just on a side note, I would generally advise against compiling the whole node_modules folder, simply because it's usually massive.

Instead I'd have the site.scss file like yours in a folder with my custom source code, which then imports from _node_modules like @import '../node_modules/boostrap/...

JayCallas commented 2 years ago

Thanks for the response Johan. I think for the first answer you provided, you did not understand my request -- I am not interested directly in compiling the files under node_modules...I want to include them in the compiling of my custom files.. The option I mentioned in my original post is for using the included path as a base path on the@imports.

Your second response, fully specifying the relative path, was the answer (and the one I was hoping to not have to use).

Thank you.