{"id":15041632,"url":"https://github.com/javierbrea/node-sass-alias-importer","last_synced_at":"2025-09-17T15:59:24.373Z","repository":{"id":34933261,"uuid":"192567652","full_name":"javierbrea/node-sass-alias-importer","owner":"javierbrea","description":"Node sass importer supporting custom alias for directories or specific files","archived":false,"fork":false,"pushed_at":"2024-04-25T21:46:39.000Z","size":510,"stargazers_count":7,"open_issues_count":5,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T12:23:59.794Z","etag":null,"topics":["alias","aliases","custom","customization","directories","directory","file","files","folder","node-sass","node-sass-importer","path","rollup","sass","webpack"],"latest_commit_sha":null,"homepage":"","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/javierbrea.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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":"2019-06-18T15:31:19.000Z","updated_at":"2023-02-17T02:57:51.000Z","dependencies_parsed_at":"2024-06-18T21:30:59.807Z","dependency_job_id":"6d6d8a48-058c-4e7e-bef2-4ff30b858b8e","html_url":"https://github.com/javierbrea/node-sass-alias-importer","commit_stats":{"total_commits":97,"total_committers":5,"mean_commits":19.4,"dds":0.134020618556701,"last_synced_commit":"ab88bb82506dac88cc9152f3e5173d4f56c0420f"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/javierbrea/node-sass-alias-importer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierbrea%2Fnode-sass-alias-importer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierbrea%2Fnode-sass-alias-importer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierbrea%2Fnode-sass-alias-importer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierbrea%2Fnode-sass-alias-importer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javierbrea","download_url":"https://codeload.github.com/javierbrea/node-sass-alias-importer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierbrea%2Fnode-sass-alias-importer/sbom","scorecard":{"id":508292,"data":{"date":"2025-08-11","repo":{"name":"github.com/javierbrea/node-sass-alias-importer","commit":"c679e55bb5e10f687e0dc5343f9120a877ac02a8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/9 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/check-package-version.yml:1","Warn: no topLevel permission defined: .github/workflows/publish-to-github-registry.yml:1","Warn: no topLevel permission defined: .github/workflows/publish-to-npm.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:84: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:88: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:93: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:97: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check-package-version.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/check-package-version.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/check-package-version.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/check-package-version.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/check-package-version.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/check-package-version.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/check-package-version.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/check-package-version.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/check-package-version.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/check-package-version.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-to-github-registry.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/publish-to-github-registry.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-to-github-registry.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/publish-to-github-registry.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish-to-github-registry.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/publish-to-github-registry.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-to-npm.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/publish-to-npm.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish-to-npm.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/javierbrea/node-sass-alias-importer/publish-to-npm.yml/master?enable=pin","Info:   0 out of  14 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   7 third-party GitHubAction dependencies pinned","Info:   3 out of   3 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"15 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-7mwh-4pqv-wmr8","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T23:48:26.536Z","repository_id":34933261,"created_at":"2025-08-19T23:48:26.536Z","updated_at":"2025-08-19T23:48:26.536Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275622545,"owners_count":25498326,"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","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["alias","aliases","custom","customization","directories","directory","file","files","folder","node-sass","node-sass-importer","path","rollup","sass","webpack"],"created_at":"2024-09-24T20:46:18.542Z","updated_at":"2025-09-17T15:59:24.328Z","avatar_url":"https://github.com/javierbrea.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build status][build-image]][build-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Quality Gate][quality-gate-image]][quality-gate-url]\n\n[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com) [![Last commit][last-commit-image]][last-commit-url] [![Last release][release-image]][release-url] \n\n[![NPM downloads][npm-downloads-image]][npm-downloads-url] [![License][license-image]][license-url]\n\n# Node Sass Alias Importer\n\nNode sass importer supporting custom alias for directories or specific files.\n\n## Install\n\n```bash\nnpm i --save-dev node-sass-alias-importer\n```\n\n## Usage\n\nDefine aliases for directories or specific files in `sass` imports as it is done in `javascript` using the [babel-plugin-module-resolver package](https://www.npmjs.com/package/babel-plugin-module-resolver).\n\n```js\nconst sass = require(\"node-sass\");\nconst aliasImporter = require(\"node-sass-alias-importer\");\n\nsass.render({\n  file: \"./src/components/foo/foo.scss\",\n  importer: [\n    aliasImporter({\n      themes: \"./src/styles/themes\",\n      variables: \"./src/styles/variables/index\"\n    })\n  ]\n});\n```\n\nNow you can use aliases for importing specific files, or as base paths in your `import` statements:\n\n```\n// file: src/components/foo/foo.scss\n\n@import \"themes/foo-theme/index\";\n// Resolved as \"../../styles/themes/foo-theme/index\"\n\n@import \"variables\";\n// Resolved as \"../../styles/variables/index\"\n```\n\n## Options\n\n`aliasImporter(aliases [,options])`\n* Arguments\n\t* aliases - _`\u003cObject\u003e`_ Object containing aliases as keys, relative or absolute paths as values.\n\t* options - _`\u003cObject\u003e`_\n\t\t* root - _`\u003cString\u003e`_ Base path for all defined aliases. Default `process.cwd()`\n\n## Examples\n\n### Usage with Rollup\n\n```js\nconst sassPlugin = require(\"rollup-plugin-sass\");\nconst sass = require(\"node-sass\");\nconst aliasImporter = require(\"node-sass-alias-importer\");\n\nmodule.exports = {\n  input: \"src/index.js\",\n  output: {\n    file: \"dist/index.js\"\n  },\n  plugins: [\n    sassPlugin({\n      insert: true,\n      runtime: sass,\n      options: {\n        importer: aliasImporter(\n          {\n            themes: \"themes\",\n            variables: \"variables/index\"\n          },\n          {\n            root: \"./src/styles\"\n          }\n        )\n      }\n    })\n  ]\n};\n```\n\n### Usage with Webpack\n\n```js\nconst aliasImporter = require(\"node-sass-alias-importer\");\n\nmodule.exports = () =\u003e ({\n  entry: [\"./src/index.js\"],\n  module: {\n    rules: [\n      {\n        test: /\\.scss$/,\n        use: [\n          \"style-loader\",\n          \"css-loader\",\n          {\n            loader: \"sass-loader\",\n            options: {\n              importer: aliasImporter({\n                variables: \"./src/styles/variables/index\"\n              })\n            }\n          }\n        ],\n        include: path.resolve(__dirname, \"src\")\n      }\n    ]\n  }\n});\n```\n\n## Alternatives\n\n### Webpack\n\nIf you are using Webpack and [sass-loader](https://github.com/webpack-contrib/sass-loader), you can use the Webpack's `resolve.alias` option directly:\n\n```js\n// webpack.config.js\n\nmodule.exports = {\n  //...\n  resolve: {\n    alias: {\n      themes: path.resolve(__dirname, \"src/styles/themes\"),\n      variables: path.resolve(__dirname, \"src/styles/variables/index\")\n    },\n  },\n};\n\n```\n\n\n\n## License\n\nMIT, see [LICENSE](./LICENSE) for details.\n\n[coveralls-image]: https://coveralls.io/repos/github/javierbrea/node-sass-alias-importer/badge.svg\n[coveralls-url]: https://coveralls.io/github/javierbrea/node-sass-alias-importer\n[build-image]: https://github.com/javierbrea/node-sass-alias-importer/workflows/build/badge.svg?branch=master\n[build-url]: https://github.com/javierbrea/node-sass-alias-importer/actions?query=workflow%3Abuild+branch%3Amaster\n[last-commit-image]: https://img.shields.io/github/last-commit/javierbrea/node-sass-alias-importer.svg\n[last-commit-url]: https://github.com/javierbrea/node-sass-alias-importer/commits\n[license-image]: https://img.shields.io/npm/l/node-sass-alias-importer.svg\n[license-url]: https://github.com/javierbrea/node-sass-alias-importer/blob/master/LICENSE\n[npm-downloads-image]: https://img.shields.io/npm/dm/node-sass-alias-importer.svg\n[npm-downloads-url]: https://www.npmjs.com/package/node-sass-alias-importer\n[quality-gate-image]: https://sonarcloud.io/api/project_badges/measure?project=javierbrea_node-sass-alias-importer\u0026metric=alert_status\n[quality-gate-url]: https://sonarcloud.io/dashboard?id=javierbrea_node-sass-alias-importer\n[release-image]: https://img.shields.io/github/release-date/javierbrea/node-sass-alias-importer.svg\n[release-url]: https://github.com/javierbrea/node-sass-alias-importer/releases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavierbrea%2Fnode-sass-alias-importer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavierbrea%2Fnode-sass-alias-importer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavierbrea%2Fnode-sass-alias-importer/lists"}