{"id":15561145,"url":"https://github.com/reactway/scss-bundle","last_synced_at":"2025-04-06T07:13:15.903Z","repository":{"id":35065562,"uuid":"64765599","full_name":"reactway/scss-bundle","owner":"reactway","description":"Bundling SCSS files to one bundled file.","archived":false,"fork":false,"pushed_at":"2024-08-16T17:49:35.000Z","size":1560,"stargazers_count":57,"open_issues_count":29,"forks_count":26,"subscribers_count":7,"default_branch":"dev","last_synced_at":"2025-03-30T05:07:22.275Z","etag":null,"topics":["bundle","cli","scss","scss-files"],"latest_commit_sha":null,"homepage":"","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/reactway.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":"2016-08-02T14:49:19.000Z","updated_at":"2025-02-19T00:40:52.000Z","dependencies_parsed_at":"2024-06-18T13:37:39.889Z","dependency_job_id":"16c40b7d-1317-49d1-9e26-4d2c62963106","html_url":"https://github.com/reactway/scss-bundle","commit_stats":{"total_commits":123,"total_committers":21,"mean_commits":5.857142857142857,"dds":0.5853658536585367,"last_synced_commit":"82ebbe39efd01ec3cf224950bd6bb89a6de5ab5a"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactway%2Fscss-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactway%2Fscss-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactway%2Fscss-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactway%2Fscss-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reactway","download_url":"https://codeload.github.com/reactway/scss-bundle/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445671,"owners_count":20939958,"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":["bundle","cli","scss","scss-files"],"created_at":"2024-10-02T16:05:44.775Z","updated_at":"2025-04-06T07:13:15.885Z","avatar_url":"https://github.com/reactway.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **Warning**\n\u003e scss-bundle still works for use-cases without @use directive, but to support new SCSS module sytem [a bigger rewrite would be needed](https://github.com/reactway/scss-bundle/issues/90#issuecomment-619390804). Thus, we are not archiving the project to be read-only, but we will not contribute to it. In case someone wants to take it over, please open an issue.\n\u003e If you use `scss-bundle` to export scss assets from an angular library, there is already [angular team solution](https://angular.io/guide/creating-libraries#managing-assets-in-a-library)\n\n# scss-bundle\n\nBundles all SCSS imports into a single file recursively.\n\n[![NPM version](https://img.shields.io/npm/v/scss-bundle.svg?logo=npm)](https://www.npmjs.com/package/scss-bundle)\n[![NPM version](https://img.shields.io/npm/v/scss-bundle/canary.svg?logo=npm)](https://www.npmjs.com/package/scss-bundle/v/canary)\n\n[![Total downloads](https://img.shields.io/npm/dt/scss-bundle.svg)](https://www.npmjs.com/package/scss-bundle)\n[![Build Status](https://img.shields.io/azure-devops/build/reactway/reactway/13/master.svg?logo=azuredevops)](https://dev.azure.com/reactway/ReactWay/_build/latest?definitionId=13\u0026branchName=master)\n[![Code coverage](https://img.shields.io/azure-devops/coverage/reactway/reactway/13/master.svg)](https://dev.azure.com/reactway/ReactWay/_build/latest?definitionId=13\u0026branchName=master)\n\n[![Dependencies](https://img.shields.io/david/reactway/tiny-emitter.svg)](https://david-dm.org/reactway/scss-bundle)\n[![Dev dependencies](https://img.shields.io/david/dev/reactway/tiny-emitter.svg)](https://david-dm.org/reactway/scss-bundle?type=dev)\n\n### Who uses `scss-bundle`\n\n#### Projects\n\n-   [Angular/material2](https://github.com/angular/material2)\n-   [Grassy](https://github.com/lazarljubenovic/grassy)\n\n#### Community plugins\n\n-   [rollup-plugin-bundle-scss](https://github.com/weizhenye/rollup-plugin-bundle-scss)\n\n## Get started\n\nIf you want to use `scss-bundle` globally\n\n```sh\n$ npm install scss-bundle -g\n```\n\nLatest dev build is published under `canary` tag.\n\n```sh\n$ npm install scss-bundle@canary\n```\n\nTo start using the tool, create a [config](#example-config) file and run command:\n\n```\n$ scss-bundle\n```\n\nIt will bundle all scss files in specified `outFile` location.\n\n## CLI Usage\n\n```sh\n$ scss-bundle -h\n```\n\n## Configuration\n\nConfig file properties can be overridden with CLI flags.\n\n| CLI Flag                                | Bundler options          | Type     | Description                                                       | Values                                     | Default |\n| --------------------------------------- | ------------------------ | -------- | ----------------------------------------------------------------- | ------------------------------------------ | ------- |\n| -c, --config \\\u003cpath\\\u003e                   |                          | string   | Configuration file location.                                      |                                            |         |\n| -p, --project \\\u003cpath\\\u003e                  | project                  | string   | Project location where `node_modules` is located.                 |                                            |         |\n| -e, --entryFile \\\u003cpath\\\u003e \u003csup\u003e`*`\u003c/sup\u003e | entryFile \u003csup\u003e`*`\u003c/sup\u003e | string   | Bundle entry file location.                                       |                                            |         |\n| -o, --outFile \\\u003cpath\\\u003e \u003csup\u003e`*`\u003c/sup\u003e   | outFile \u003csup\u003e`*`\u003c/sup\u003e   | string   | Bundle output location.                                           |                                            |         |\n| --rootDir \\\u003cpath\\\u003e                      | rootDir                  | string   | Specifies the root directory of input files.                      |                                            |         |\n| -w, --watch [boolean]                   | watch                    | boolean  | Watch files for changes. Works with `rootDir`.                    |                                            |         |\n| --ignoreImports \\\u003clist\\\u003e                | ignoreImports            | string[] | Ignore resolving import content by matching a regular expression. |                                            |         |\n| --includePaths \\\u003clist\\\u003e                 | includePaths             | string[] | Include paths for resolving imports.                              |                                            |         |\n| --dedupeGlobs \\\u003clist\\\u003e                  | dedupeGlobs              | string[] | Files that will be emitted in a bundle once.                      |                                            |         |\n| --logLevel \\\u003clevel\\\u003e                    | logLevel                 | string   | Console log level.                                                | silent, error, warning, info, debug, trace | info    |\n\n`*` - Required\n\n### Example config\n\nDefault name for configuration is `scss-bundle.config.json`.\n\n```json\n{\n    \"bundlerOptions\": {\n        \"entryFile\": \"./tests/cases/simple/main.scss\",\n        \"rootDir\": \"./tests/cases/simple/\",\n        \"outFile\": \"./bundled.scss\",\n        \"ignoreImports\": [\"~@angular/.*\"],\n        \"logLevel\": \"silent\"\n    }\n}\n```\n\n## Non-CLI usage\n\n### Simple example\n\n```typescript\nimport path from \"path\";\nimport { Bundler } from \"scss-bundle\";\n\n(async () =\u003e {\n    // Absolute project directory path.\n    const projectDirectory = path.resolve(__dirname, \"./cases/tilde-import\");\n    const bundler = new Bundler(undefined, projectDirectory);\n    // Relative file path to project directory path.\n    const result = await bundler.bundle(\"./main.scss\");\n})();\n```\n\n# API\n\n## Bundler\n\n```typescript\nimport { Bundler } from \"scss-bundle\";\n```\n\n### Constructor\n\n```ts\nconstructor(fileRegistry: FileRegistry = {}, projectDirectory?: string) {}\n```\n\n##### Arguments\n\n-   `fileRegistry?:` [Registry](#registry) - Dictionary of files contents by full path\n-   `projectDirectory?: string` - Absolute project location, where `node_modules` are located. Used for resolving tilde imports\n\n### Methods\n\n#### bundle\n\n```typescript\npublic async bundle(file: string, fileRegistry: Registry = {}): Promise\u003cBundleResult\u003e\n```\n\n##### Arguments\n\n-   `file: string` - Main file full path\n-   `fileRegistry:` [Registry](#registry) - Dictionary of files contents by full path\n\n##### Returns\n\n`Promise\u003c`[BundleResult](#bundleresult)`\u003e`\n\n### Contracts\n\n#### BundleResult\n\n```typescript\nimport { BundleResult } from \"scss-bundle\";\n```\n\n```typescript\ninterface BundleResult {\n    imports?: BundleResult[];\n    tilde?: boolean;\n    deduped?: boolean;\n    filePath: string;\n    bundledContent?: string;\n    found: boolean;\n    ignored?: boolean;\n}\n```\n\n##### Properties\n\n-   `imports:` [BundleResult](#bundleresult)`[]` - File imports array\n-   `tilde?: boolean` - Used tilde import\n-   `filePath: string` - Full file path\n-   `bundledContent?: string` - File content\n-   `found: boolean` - Is file found\n\n#### Registry\n\n```typescript\nimport { Registry } from \"scss-bundle\";\n```\n\n```typescript\ninterface Registry {\n    [id: string]: string | undefined;\n}\n```\n\n##### Key\n\n`id: string` - File full path as dictionary id\n\n##### Value\n\n`string | undefined` - File content\n\n## License\n\nReleased under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactway%2Fscss-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactway%2Fscss-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactway%2Fscss-bundle/lists"}