Strangely, the loadPaths attribute doesn't work, what worked for me was using includePaths:

                {
                    loader: 'sass-loader',
                    options: {
                        sassOptions: {
                            includePaths: [path.resolve(__dirname, 'Develop', 'Styles')]
                        }
                    }
                }
Answer from violetflare on Stack Overflow
🌐
Customink
technology.customink.com › blog › 2014 › 10 › 09 › understanding-and-using-sass-load-paths
Understanding and Using Sass Load Paths - CustomInk Technology Blog
For those of you that are aware ... Sass gems, and Bower Sass dependencies in the SASS_PATH. The Sass load paths let Sass know the directories it should look in when trying to import files....
Discussions

When using SASS how can I import a file from a different directory? - Stack Overflow
Of course, this solution is far from pretty, but I couldn't get an import from a totally different folder to work, neither using I c:\projects\sass nor setting the environment variable SASS_PATH (from: :load_paths reference) to that same value. More on stackoverflow.com
🌐 stackoverflow.com
What does "A load path `loadpath`..." mean?
sass/js-api-doc/options.d.ts Line 228 in 850c7e0 * A load path `loadPath` is equivalent to the following {@link FileImporter}: More on github.com
🌐 github.com
3
December 8, 2023
How to batch compile Sass with relative paths?
Not sure what exactly you need to do. Do you need a lot of compelled files or do you want your code to be in one file? In the case is the latter here is what you can do. What you can do if you are using the latest DART Sass is to utilize the @use see documentation to import code to index files and from there load them to a main index file, the one that you should compile. Let me give you an example: sass/ folder1/ index.scss somefile01.scss somefile02.scss folder2/ index.scss somefile01.scss somefile02.scss subfolder1/ index.scss somefile01.scss somefile02.scss folder1/ index.scss somefile01.scss somefile02.scss main.scss So what you can do is to place the scss files into folders, to keep them organized, and then create an index.scss file in each folder. The index.scss file should have an @forward see documentation directive to forward the files of the folder. Then in your main.scss you can load folders and files by using the @use. If you want to import folder1/ and all it's contents, you can write in your main.scss: @use 'folder1'; This will check the index file of folder 1 and import all the forwarded files. (Be careful, if you have a folder and a file in the same directory that shares the same name, you will have a conflict and unpredictable code). This way, if you have mixins functions variables etc in one file, you can load them to another using the @use. In this case, you will also need to declare a namespace. For example: @use 'file1' as *; @use 'file2' as someName; This will compile all files that you include into one compelled file. More on reddit.com
🌐 r/Sass
6
1
May 12, 2023
Accept multiple Sass load paths
Currently a sass_dir is configured like this. The directory is now the Sass load path. sass: sass_dir: _sass I propose allowing this: sass: sass_dir: - _sass - bower_components Both directories sho... More on github.com
🌐 github.com
3
January 26, 2015
🌐
Sass
sass-lang.com › documentation › cli › dart-sass
Sass: Dart Sass Command-Line Interface
Earlier load paths will take precedence over later ones. $ sass --load-path=node_modules/bootstrap/dist/css style.scss style.css
🌐
Sass
sass-lang.com › documentation › at-rules › use
Sass: @use
All Sass implementations allow users to provide load paths: paths on the filesystem that Sass will look in when locating modules.
🌐
RubyDoc
rubydoc.info › gems › sass › Sass.load_paths
RubyDoc.info: Method: Sass.load_paths – Documentation for sass (3.7.4) – RubyDoc.info
The global load paths for Sass files. This is meant for plugins and libraries to register the paths to their Sass stylesheets to that they may be @imported. This load path is used by every instance of Engine.
🌐
Sass
sass-lang.com › documentation › at-rules › import
Sass: @import
For example, if you pass node_modules/susy/sass as a load path, you can use @import "susy" to load node_modules/susy/sass/susy.scss.
🌐
Google Groups
groups.google.com › g › rubyonrails-talk › c › Qsqm3HfRaJ0
SASS load path?
If you still want to load your scss file from vendor/assets/components, you can add it to the sass load paths (as you've done), and that should work after a server restart.
Find elsewhere
🌐
Sass
sass-lang.com › documentation › js-api › interfaces › options
Sass: Options | JS API
Since it doesn’t have a path of its own, everything it loads is coming from a load path rather than a relative import. ... A set of active deprecations to ignore. If a deprecation warning of any provided type is encountered during compilation, the compiler will ignore it instead. The deprecated functionality you’re depending on will eventually break. ... By default, Dart Sass will print only five instances of the same deprecation warning per compilation to avoid deluging users in console noise.
🌐
GitHub
github.com › sass › sass › issues › 3759
What does "A load path `loadpath`..." mean? · Issue #3759 · sass/sass
December 8, 2023 - sass/js-api-doc/options.d.ts · Line 228 in 850c7e0 · * A load path `loadPath` is equivalent to the following {@link FileImporter}: Reactions are currently unavailable · nex3 · No labels · No labels · No type · No projects · No milestone · None yet · No branches or pull requests ·
Author   davidmurdoch
🌐
Thoughtbot
thoughtbot.com › blog › sass-pathways
Sass Pathways
January 10, 2025 - When Sass compiles a pathway, it ... As Sass compiles the pathway, it loads any variables, mixins, functions, placeholders and declarations into the global namespace for that pathway....
🌐
Reddit
reddit.com › r/sass › how to batch compile sass with relative paths?
r/Sass on Reddit: How to batch compile Sass with relative paths?
May 12, 2023 -

Hi! I have a pretty big project that has lots of subfolders, each of which has an instance of SCSS/CSS files that need compiling. I've been using the sass npm package for a while now and I manually input each file in a large script, like this:

sass --watch --no-source-map --style compressed project1/src/scss/project1.scss:project1/src/css/project1.css project2/src/scss/project2.scss:project2/src/css/project2.css ...

This is obviously very inefficient as there are now at least 50 of those SCSS files in the project. I'm searching for a way to automate it using relative paths. I tried paths like these: **/src/scss/*.scss:**/src/css/*.css but couldn't find a way to make it work.

I can do it with a VS Code extension as it supports such filepaths, but I'd rather do it with the npm package. I might be missing something, any idea?

Thank you!

Top answer
1 of 2
2
Not sure what exactly you need to do. Do you need a lot of compelled files or do you want your code to be in one file? In the case is the latter here is what you can do. What you can do if you are using the latest DART Sass is to utilize the @use see documentation to import code to index files and from there load them to a main index file, the one that you should compile. Let me give you an example: sass/ folder1/ index.scss somefile01.scss somefile02.scss folder2/ index.scss somefile01.scss somefile02.scss subfolder1/ index.scss somefile01.scss somefile02.scss folder1/ index.scss somefile01.scss somefile02.scss main.scss So what you can do is to place the scss files into folders, to keep them organized, and then create an index.scss file in each folder. The index.scss file should have an @forward see documentation directive to forward the files of the folder. Then in your main.scss you can load folders and files by using the @use. If you want to import folder1/ and all it's contents, you can write in your main.scss: @use 'folder1'; This will check the index file of folder 1 and import all the forwarded files. (Be careful, if you have a folder and a file in the same directory that shares the same name, you will have a conflict and unpredictable code). This way, if you have mixins functions variables etc in one file, you can load them to another using the @use. In this case, you will also need to declare a namespace. For example: @use 'file1' as *; @use 'file2' as someName; This will compile all files that you include into one compelled file.
2 of 2
1
Perhaps look into Gulp and Gulp-Sass. A Quick Google returned this https://youtu.be/UAELtmmeA80
🌐
GitHub
github.com › jekyll › jekyll › issues › 3366
Accept multiple Sass load paths · Issue #3366 · jekyll/jekyll
January 26, 2015 - Currently a sass_dir is configured like this. The directory is now the Sass load path. sass: sass_dir: _sass I propose allowing this: sass: sass_dir: - _sass - bower_components Both directories sho...
Author   wjdp
🌐
Google Groups
groups.google.com › g › haml › c › WkB5lH20se8
Specifying multiple directories in sass --load-path from command line
November 29, 2010 - I think I found the solution. It seems like you can specify multiple --load-path's in the command line. Thus: sass --load-path a --load-path b c/main.scss css/main.css ...seems to work.
🌐
GitHub
github.com › sass › dart-sass › issues › 2015
Possible issue the --load-path · Issue #2015 · sass/dart-sass
June 13, 2023 - sass --watch --load-path=node_modules/ src/styles/stylesheet.scss public/style.css
Author   panoply
🌐
Ruby-Forum
ruby-forum.com › rails
SASS load path? - Rails - Ruby-Forum
March 15, 2016 - Putting this in my application.css.scss does not load the sass library. @import ‘foundation.scss’; Even if I put this in my config. config.sass.load_paths << Rails.root.join( ‘vendor’, ‘assets’, ‘components’, ‘founda…
🌐
GitHub
gist.github.com › adamstac › 9328069
Sass command to specify a load-path and compile the Sass · GitHub
August 17, 2020 - Sass command to specify a load-path and compile the Sass · Raw · gistfile1.txt · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
🌐
GitHub
github.com › sass › sass › issues › 131
Add a global load_path · Issue #131 · sass/sass
July 7, 2011 - require "sass" Sass::Engine.load_path << File.expand_path("../my_mixins_directory", __FILE__) # or maybe even Sass::Engine.add_load_path File.expand_path("../my_mixins_directory", __FILE__)
🌐
Sass
sass-lang.com › documentation › js-api › interfaces › legacyfileoptions
Sass: LegacyFileOptions | JS API
Earlier versions of Dart Sass and Node Sass didn’t support the SASS_PATH environment variable. This array of strings option provides load paths for Sass to look for stylesheets.