{"id":15041625,"url":"https://github.com/strarsis/sass-include-paths","last_synced_at":"2025-04-14T20:23:33.765Z","repository":{"id":71888869,"uuid":"46237976","full_name":"strarsis/sass-include-paths","owner":"strarsis","description":"Generates include paths for node-sass for packages from popular package managers like npm, bower, ruby gem, ruby bundler.","archived":false,"fork":false,"pushed_at":"2019-03-25T21:01:14.000Z","size":54,"stargazers_count":12,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T08:41:30.798Z","etag":null,"topics":["eyeglass","include","node-sass","package","path","ruby-sass","rubygems","sass","sass-files"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strarsis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-15T22:04:45.000Z","updated_at":"2022-07-19T18:01:59.000Z","dependencies_parsed_at":"2023-07-26T06:46:26.699Z","dependency_job_id":null,"html_url":"https://github.com/strarsis/sass-include-paths","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strarsis%2Fsass-include-paths","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strarsis%2Fsass-include-paths/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strarsis%2Fsass-include-paths/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strarsis%2Fsass-include-paths/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strarsis","download_url":"https://codeload.github.com/strarsis/sass-include-paths/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248953180,"owners_count":21188594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eyeglass","include","node-sass","package","path","ruby-sass","rubygems","sass","sass-files"],"created_at":"2024-09-24T20:46:17.948Z","updated_at":"2025-04-14T20:23:33.727Z","avatar_url":"https://github.com/strarsis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sass-include-paths\nGenerates include paths for node-sass for packages from popular package managers like npm, bower, ruby gem, ruby bundler.\n\n[![david](https://david-dm.org/strarsis/sass-include-paths.svg)](https://david-dm.org/strarsis/sass-include-paths)\n\n[![NPM](https://nodei.co/npm/sass-include-paths.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/sass-include-paths/)\n\nThe generated array with the include paths can be passed to node-sass.\n\nAllows interoperability between sass variants, ruby sass, libsass and sass-eyeglass (libsass + eyeglass)\n\n\nAsync/Sync\n----------\nThis module offers an async and a sync version of each function.\nThe async version returns a thenable (Promise based) for easier chaining.\nThe sync version is intended for being used in tools like Gulp where this doesn't matter in a task.\n\n\nMethods\n-------\n\n### node modules\nFor node modules that contain SCSS/SASS files.\n\n#### nodeModulesSync()\nSync version, returns the array directly.\n\n#### nodeModules()\nAsync version, returns a theneable.\n\n\n\n### bower components\nFor bower components that contain SCSS/SASS files.\n\n#### bowerComponentsSync()\nSync version, returns the array directly.\n\n#### bowerComponents()\nAsync version, returns a theneable.\n\n\n\n### bundled ruby gems\nFor bundled ruby gems installed in folder by bundler (default is ./vendor/bundle) that contain SCSS/SASS files.\n\n#### rubyGemsBundleSync()\nSync version, returns the array directly.\n\n#### rubyGemsBundle()\nAsync version, returns a theneable.\n\n\n\n### system/global ruby gems\nFor ruby gems installed on current (activated/available) ruby environment (system/globally installed gems) that contain SCSS/SASS files.\n\n#### rubyGemsSync()\nSync version, returns the array directly.\n\n#### rubyGems()\nAsync version, returns a theneable.\n\n\n\nUsage\n-----\n\nRequire this module and optionally define an array of include paths, \neither empty or already with some paths to include:\n```javascript\nvar sassIncl = require('sass-include-paths'),\n    scssIncludePaths = [];\n````\n\nWhen the module functions are invoked outside the task scope,\nthe scan is run only once when gulp is started, notably when using gulp-watch.\nThis spares extra scans each time workspace files are changed.\nWhen packages, gems or bower components are changed, gulp watch has to be restarted for a rescan.\n\n\nFor importing sass/scss files from sass/eyeglass npm packages...\n#### using gulp-ruby-sass (ruby sass)\n```javascript\n[...]\nscssIncludePaths = [] // additional include paths\n  .concat(sassIncl.nodeModulesSync());\n[...]\n  rubySass(srcAssets.scss + '/*.scss', {\n    loadPath: scssIncludePaths\n  })\n[...]\n````\nAs gulp-ruby-sass (ruby-sass) already imports sass/scss files from ruby gems \n(autorequired by Gemfile or explicitly required in compass config.rb or elsewhere), \nthere is no need to pass paths to these, too.\n\n\nFor importing sass/scss files from plain or eyeglass npm packges and from ruby gems and local bundle...\n#### using gulp-sass (plain libsass)\n```javascript\n[...]\nscssIncludePaths = [] // additional include paths\n  .concat(sassIncl.nodeModulesSync())\n  .concat(sassIncl.rubyGemsSync())\n  .concat(sassIncl.rubyGemsBundleSync());\n[...]\n  .pipe(plugins.sass({\n    includePaths: scssIncludePaths\n  }))\n[...]\n````\nOne could argue using a custom importer for node-sass instead, but currently there are no custom importers \nthat scan node_modules/ because in most opinions this should be handled by eyeglass (libsass + eyeglass) instead, \nhowever, even using eyeglass, there is still an use case (see further below).\n\n\nFor importing sass/scss files from plain npm packages and from ruby gems and local bundle...\n#### using eyeglass (libsass + eyeglass) \n```javascript\n[...]\n// Outside the gulp task\nscssIncludePaths = [] // additional include paths\n  .concat(sassIncl.nodeModulesSync())\n  .concat(sassIncl.rubyGemsSync())\n  .concat(sassIncl.rubyGemsBundleSync()):\n[...]\nvar eyeglass = new Eyeglass({\n  includePaths: scssIncludePaths\n});\n[...]\n````\nOne use case to also add node_module paths when using eyeglass \nis to be able to import npm packages that haven't been made eyeglass-ready yet.\nThough it may work fine using this module, please still consider creating an issue \nto inform the package creator that eyeglass metadata is still missing for the package.\n\n\n### CLI/sassc usage\nA cli wrapper comes with this module which can generate the list of include paths to be used on cli.\nFor sassc-compatible options output, pass the --sassc switch.\nExample:\n````\n$ npm install -g sass-include-paths\n$ sassc $(sassIncludePaths --sassc --node_modules --bower_components) [...]\n````\nNote: `$(...)` executes the command and re-uses its stdout.\n\n\n\n\nDevelopment\n-----------\nIn order to run the tests, npm, bower and ruby gem/bundler have to be available.\nbower will be installed as development dependency of this package.\nFor consistent tests, the ruby and node versions have been locked using rvm/nvm config files, \nso both or similar tools have to be installed to ensure the right versions and isolation.\n\n./test/prepare.sh can be run after `npm install` for quickly installing the bower dependencies and ruby bundle.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrarsis%2Fsass-include-paths","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrarsis%2Fsass-include-paths","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrarsis%2Fsass-include-paths/lists"}