node-sass
(the official SASS wrapper for node.js
) provides a command line option --include-path
to help with such requirements.
Example:
In package.json
:
"scripts": {
"build-css": "node-sass src/ -o src/ --include-path src/",
}
Now, if you have a file src/styles/common.scss
in your project, you can import it with @import 'styles/common';
anywhere in your project.
Refer https://github.com/sass/node-sass#usage-1 for more details.