{"id":13774041,"url":"https://github.com/mtojo/rollup-plugin-stylus-css-modules","last_synced_at":"2025-10-23T15:31:55.259Z","repository":{"id":71877963,"uuid":"51004125","full_name":"mtojo/rollup-plugin-stylus-css-modules","owner":"mtojo","description":"A Rollup.js plugin to compile Stylus and inject CSS Modules","archived":false,"fork":false,"pushed_at":"2017-07-20T01:12:42.000Z","size":18,"stargazers_count":14,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T08:07:36.424Z","etag":null,"topics":["css-modules","rollup-plugin","stylus"],"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/mtojo.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}},"created_at":"2016-02-03T14:15:31.000Z","updated_at":"2023-09-07T17:05:29.000Z","dependencies_parsed_at":"2024-01-13T11:57:44.020Z","dependency_job_id":"72c4baa7-cfc7-4808-9f13-f8c08440a318","html_url":"https://github.com/mtojo/rollup-plugin-stylus-css-modules","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtojo%2Frollup-plugin-stylus-css-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtojo%2Frollup-plugin-stylus-css-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtojo%2Frollup-plugin-stylus-css-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtojo%2Frollup-plugin-stylus-css-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtojo","download_url":"https://codeload.github.com/mtojo/rollup-plugin-stylus-css-modules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237852503,"owners_count":19376697,"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":["css-modules","rollup-plugin","stylus"],"created_at":"2024-08-03T17:01:23.144Z","updated_at":"2025-10-23T15:31:49.974Z","avatar_url":"https://github.com/mtojo.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["CSS"],"readme":"# rollup-plugin-stylus-css-modules\n\n[![Build Status](https://travis-ci.org/mtojo/rollup-plugin-stylus-css-modules.svg?branch=master)](https://travis-ci.org/mtojo/rollup-plugin-stylus-css-modules)\n\nA Rollup.js plugin to compile Stylus and inject [CSS Modules](https://github.com/css-modules/css-modules).\n\n## Installation\n\n```bash\n$ npm install --save-dev rollup-plugin-stylus-css-modules\n```\n\n## Usage\n\nAdd the following code to your project's `rollup.config.js`:\n\n```js\nimport stylusCssModules from 'rollup-plugin-stylus-css-modules';\n\nexport default {\n  entry: 'index.js',\n  plugins: [\n    stylusCssModules({\n      output: 'styles.css'\n    })\n  ]\n};\n```\n\n### in Stylus\n\n```stylus\n.container\n  height 100%\n```\n\n### in JS\n\n```js\nimport styles from './styles.styl';\nconst container = `\u003cdiv class=\"${styles.container}\"\u003e...\u003c/div\u003e`;\n```\n\n## Options\n\n* `include`, `exclude`: A minimatch pattern, or an array of minimatch patterns of including ID, or excluding ID (optional).\n* `output`: Output destination (optional).\n  * If you specify as `string`, it will be the path to write the generated CSS.\n  * If you specify as `function`, call it passing the generated CSS as an argument.\n  * If you specify the `false`, CSS will not be output.\n  * If this option is not specified, the generated CSS will still be imported (See [Use with other CSS plugins](#use-with-other-css-plugins)).\n* `sourceMap`: If `true` is specified, source map to be embedded in the output CSS (default is `true`).\n* `fn`: A function invoked with the Stylus renderer (it will be passed to `use()` function of the Stylus).\n\n## Use with external tools\n\nCombination with external tools, such as [PostCSS](http://postcss.org/) works perfectly.\n\n```js\nstylusCssModules({\n  sourceMap: true,\n  output: (css) =\u003e {\n    return postcss([\n      // postcss' plugins...\n    ]).process(css, {\n      map: true\n    }).then((result) =\u003e {\n      fs.writeFileSync('styles.css', result.css);\n    });\n  }\n});\n```\n\n## Use with other CSS plugins\n\nYou can also use the Rollup.js plugin, such as [rollup-plugin-postcss](https://github.com/egoist/rollup-plugin-postcss), [rollup-plugin-css-only](https://github.com/thgh/rollup-plugin-css-only), etc.\n\n```js\nexport default {\n  entry: 'index.js',\n  plugins: [\n    stylusCssModules(),\n    postcss()\n  ]\n};\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtojo%2Frollup-plugin-stylus-css-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtojo%2Frollup-plugin-stylus-css-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtojo%2Frollup-plugin-stylus-css-modules/lists"}