{"id":15937822,"url":"https://github.com/jleeson/rollup-plugin-import-css","last_synced_at":"2025-04-04T18:07:06.587Z","repository":{"id":43216753,"uuid":"292121350","full_name":"jleeson/rollup-plugin-import-css","owner":"jleeson","description":"A Rollup plugin to import CSS into JavaScript","archived":false,"fork":false,"pushed_at":"2024-10-23T17:59:41.000Z","size":121,"stargazers_count":48,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-29T13:59:41.533Z","etag":null,"topics":["css","modules","plugin","rollup"],"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/jleeson.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":"2020-09-01T22:30:59.000Z","updated_at":"2024-10-25T08:28:04.000Z","dependencies_parsed_at":"2024-01-09T00:40:50.869Z","dependency_job_id":"e741e8bb-606e-475c-bc1e-dd04abf6d3bc","html_url":"https://github.com/jleeson/rollup-plugin-import-css","commit_stats":{"total_commits":37,"total_committers":4,"mean_commits":9.25,"dds":"0.10810810810810811","last_synced_commit":"00b37558751d72cee8529bb4b4d9d0e23686afbd"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jleeson%2Frollup-plugin-import-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jleeson%2Frollup-plugin-import-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jleeson%2Frollup-plugin-import-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jleeson%2Frollup-plugin-import-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jleeson","download_url":"https://codeload.github.com/jleeson/rollup-plugin-import-css/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226213,"owners_count":20904465,"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","plugin","rollup"],"created_at":"2024-10-07T05:05:06.459Z","updated_at":"2025-04-04T18:07:06.561Z","avatar_url":"https://github.com/jleeson.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["CSS"],"readme":"# rollup-plugin-import-css\nA Rollup plugin to import CSS into JavaScript\n\n![Actions](https://github.com/jleeson/rollup-plugin-import-css/workflows/build/badge.svg)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jleeson/rollup-plugin-import-css/blob/master/LICENSE)\n[![Follow Us](https://img.shields.io/badge/follow-on%20twitter-4AA1EC.svg)](https://twitter.com/jleesons)\n\n\n---\n\n## Usage\n\n```js\nimport css from \"rollup-plugin-import-css\";\n\nexport default {\n    input: \"index.js\",\n    output: { file: \"dist/index.js\", format: \"esm\" },\n    plugins: [ css() ]\n};\n```\n\nThis plugins supports three forms of importing css.\n```js\nimport \"./styles.css\"; /* extract the styles to a external css bundle */\nimport styles from \"./styles.css\"; /* import the styles as a string */\nimport styles from \"./styles.css\" with { type: \"css\" }; /* import the styles as a CSSStyleSheet */\n```\n\nNOTICE: using import attributes requires Rollup v3+\n\nIf your build uses `preserveModules`, this plugin will process and output your css files while maintaining their original file structure.\n\nThis plugin respects the import order of your css files.\n\n---\n\n## Options\n\n### include\n\nType: `array` or `string`\nDefault: `[]`\n\nA single file, or array of files to include in the plugins processing.\n\n### exclude\n\nType: `array` or `string`\nDefault: `[]`\n\nA single file, or array of files to exclude in the plugins processing.\n\n### output\n\nType: `string`\nDefault: `null`\n\nAn output file name for the css bundle. By default `output.assetFileNames` is used.\n\n### transform\n\nType: `Function`\nDefault: `null`\n\nThe transform function is used for processing the CSS, it receives a string containing the code to process as an argument. The function should return a string.\n\n### minify\n\nType: `boolean`\nDefault: `false`\n\nMinifies the css being imported. \u003cbr/\u003e\n**NOTE:** this minifier uses regex, for more complex css, you can utilize your own minifier via the `transform` function.\n\n### modules\n\nType: `boolean`\nDefault: `false`\n\nAll css files being imported with a variable will use native CSS Modules.\n\n### inject\n\nType: `boolean`\nDefault: `false`\n\nAll css files being imported will be injected into the document head at runtime.\n\n### alwaysOutput\n\nType: `boolean`\nDefault: `false`\n\nAlways output a css bundle even if the css output is empty.\n\n---\n\n## Why\n\nWith modern web frameworks, its useful to be able to import the css for components in a variety of ways. Other solutions for Rollup either lack features or are large and bloated with extra features that some users may not need such as SASS or LESS support. This plugin is small and by default only supports standard css with the option to process it further. Unlike most other css plugins this plugin maintains the order of your imports in order to avoid overwritting css unexpectedly and respects Rollup's preserveModules option. \n\n---\n\n## Reporting Issues\n\nIf you are having trouble getting something to work with this plugin or run into any problems, you can create a new [Issue](https://github.com/jleeson/rollup-plugin-import-css/issues).\n\nIf this plugin does not fit your needs or is missing a feature you would like to see, let us know! We would greatly appreciate your feedback on it.\n\n---\n\n## License\n\nrollup-plugin-import-css is licensed under the terms of the [**MIT**](https://github.com/jleeson/rollup-plugin-import-css/blob/master/LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjleeson%2Frollup-plugin-import-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjleeson%2Frollup-plugin-import-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjleeson%2Frollup-plugin-import-css/lists"}