{"id":15041603,"url":"https://github.com/luisgazcon/sass-alias","last_synced_at":"2025-04-14T20:22:37.064Z","repository":{"id":65832017,"uuid":"398893826","full_name":"LuisGazcon/sass-alias","owner":"LuisGazcon","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-02T20:38:48.000Z","size":13,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T08:41:24.163Z","etag":null,"topics":["dart-sass","node-sass","sass","sass-alias"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/sass-alias","language":"TypeScript","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/LuisGazcon.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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":"2021-08-22T20:24:37.000Z","updated_at":"2025-02-15T14:16:54.000Z","dependencies_parsed_at":"2024-06-18T22:37:08.637Z","dependency_job_id":"1f1ad5d3-bee2-40be-b4c9-8459739cbeb6","html_url":"https://github.com/LuisGazcon/sass-alias","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisGazcon%2Fsass-alias","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisGazcon%2Fsass-alias/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisGazcon%2Fsass-alias/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisGazcon%2Fsass-alias/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LuisGazcon","download_url":"https://codeload.github.com/LuisGazcon/sass-alias/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248952772,"owners_count":21188499,"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":["dart-sass","node-sass","sass","sass-alias"],"created_at":"2024-09-24T20:46:16.387Z","updated_at":"2025-04-14T20:22:37.040Z","avatar_url":"https://github.com/LuisGazcon.png","language":"TypeScript","readme":"# sass-alias\r\n\r\nsass-alias is a node-sass and dart-sass importer that brings aliasing to sass.\r\n\r\n## Installation\r\n\r\nThis package can be installed from npm or yarn by running one of the following commands.\r\n\r\n### Install using **npm**:\r\n\r\n```\r\nnpm install sass-alias\r\n```\r\n\r\n### Install using **yarn**:\r\n\r\n```\r\nyarn add sass-alias\r\n```\r\n\r\n## Introduction\r\n\r\nsass-alias brings sass the capability to import files using aliasing, this make importing more easy.\r\n\r\n## Example\r\n\r\nLet's imagine we have the following project structure:\r\n\r\n```\r\nproject\r\n├───components\r\n│\t└───button\r\n│\t\t├───button.module.scss\r\n│\t\t└───button.component.js\r\n│\r\n└───resources\r\n\t└───scss\r\n\t\t├───colors.scss\r\n\t\t└───utils.scss\r\n```\r\n\r\nIf we want to import colors into **button.module.scss** the resulting path should look like this\r\n\r\n```scss\r\n@import '../../resources/scss/colors.scss';\r\n\r\n/* more scss stuff... */\r\n```\r\n\r\nIf we use sass-alias the resulting path could look like this\r\n\r\n```scss\r\n@import '@scss/colors.scss';\r\n\r\n/* more scss stuff... */\r\n```\r\n\r\n## Configuration\r\n\r\n### using sass **node-sass** or **dart-sass**\r\n\r\n```javascript\r\nimport path from 'path';\r\nimport sass from 'sass';\r\n\r\nimport { create } from 'sass-alias';\r\n\r\nsass.renderSync({\r\n\timporter: create({\r\n\t\t'@scss': path.join(__dirname, 'scss'),\r\n\t}),\r\n});\r\n```\r\n\r\n### using sass-loader in **webpack**\r\n\r\n```javascript\r\n// webpack.config.js\r\n\r\nconst { create } = require('sass-alias');\r\n\r\nmodule.exports = {\r\n\tmodule: {\r\n\t\trules: [\r\n\t\t\t{\r\n\t\t\t\ttest: /^.*\\.(sass|scss)$/,\r\n\t\t\t\tuse: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tloader: 'sass-loader',\r\n\t\t\t\t\t\toptions: {\r\n\t\t\t\t\t\t\tsassOptions: {\r\n\t\t\t\t\t\t\t\timporter: create({\r\n\t\t\t\t\t\t\t\t\t'@scss': path.join(__dirname, 'scss'),\r\n\t\t\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t},\r\n\t\t\t\t],\r\n\t\t\t},\r\n\t\t],\r\n\t},\r\n};\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License, see the LICENSE.md file for details\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisgazcon%2Fsass-alias","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluisgazcon%2Fsass-alias","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisgazcon%2Fsass-alias/lists"}