{"id":13773923,"url":"https://github.com/RJHwang/rollup-plugin-css-porter","last_synced_at":"2025-05-11T06:31:45.748Z","repository":{"id":57355588,"uuid":"75747368","full_name":"RJHwang/rollup-plugin-css-porter","owner":"RJHwang","description":"A rollup plugin to combine css import to a standalone css file","archived":false,"fork":false,"pushed_at":"2019-04-05T03:29:20.000Z","size":32,"stargazers_count":13,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-14T14:22:25.234Z","etag":null,"topics":[],"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/RJHwang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-06T16:00:14.000Z","updated_at":"2023-06-22T11:19:28.000Z","dependencies_parsed_at":"2022-09-26T16:31:41.366Z","dependency_job_id":null,"html_url":"https://github.com/RJHwang/rollup-plugin-css-porter","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RJHwang%2Frollup-plugin-css-porter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RJHwang%2Frollup-plugin-css-porter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RJHwang%2Frollup-plugin-css-porter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RJHwang%2Frollup-plugin-css-porter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RJHwang","download_url":"https://codeload.github.com/RJHwang/rollup-plugin-css-porter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225021913,"owners_count":17408516,"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":[],"created_at":"2024-08-03T17:01:21.829Z","updated_at":"2024-11-17T09:30:24.376Z","avatar_url":"https://github.com/RJHwang.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["CSS"],"readme":"# rollup-plugin-css-porter\n\nA rollup plugin to collect and combine all the imported css file. Such as `import './my.css'`.\nThen output them to a standalone css file. Besides, use [clean-css](https://www.npmjs.com/package/clean-css)\nto create a minified css file as you wish.\n\nSupported rollup version :\n\n| plugin version | rollup version\n|----------------|----------------\n| 1.x            | 1.0.0+\n| 0.3.x          | 0.48.0~0.68.2\n| 0.1.0~0.2.x    | 0.36.0~0.47.6\n\n## Installation\n\nUse `npm`:\n\n```bash\nnpm install --save-dev rollup-plugin-css-porter\n// or\nnpm i -D rollup-plugin-css-porter\n```\n\nUse `yarn`:\n\n```bash\nyarn add rollup-plugin-css-porter --dev\n```\n\n## Plugin options\n\n| Name     | ValueType         | Required | Description\n|----------|-------------------|----------|-------------\n| dest     | `String`            | false    | Default value is the same dir of `'bundle.write(options)'` `options.file`\n| raw      | `Boolean`\u003cbr\u003e`String` | false    | 1. `Boolean` value means whether output a raw css file, default value is `true`\u003cbr\u003e2. `String` value means output raw css file to this path\n| minified | `Boolean`\u003cbr\u003e`String` | false    | 1. `Boolean` value means whether output a minified css file, default value is `true`\u003cbr\u003e2. `String` value means output minified css file to this path\n\n\u003e If set `raw` or `minified` option to a `String` value, `dest` option will be ignored.\n\n## Usage\n\n### Case 1 (default behavior):\n\nOutput to a standalone css file and a minified css file.\nThe output destination is the same dir of `'bundle.write(options)'` `options.file`.\n\n```js\nimport { rollup } from 'rollup';\nimport css from 'rollup-plugin-css-porter';\n\nrollup({\n  input: 'main.js',\n  plugins: [ css() ]\n}).then(bundle =\u003e {\n  bundle.write({\n    format: 'es',\n    file: 'bundle.js'\n  });\n});\n```\n\n### Case 2:\n\nOutput to a standalone css file without minified css file.\nThe output destination is the same dir of `'bundle.write(options)'` `options.file`.\n\n```js\nimport { rollup } from 'rollup';\nimport css from 'rollup-plugin-css-porter';\n\nrollup({\n  input: 'main.js',\n  plugins: [ css({minified: false}) ]\n}).then(bundle =\u003e {\n  bundle.write({\n    format: 'es',\n    file: 'bundle.js'\n  });\n});\n```\n\n### Case 3:\n\nOutput to a specific path if config the plugin `options.dest`.\n\n```js\nimport { rollup } from 'rollup';\nimport css from 'rollup-plugin-css-porter';\n\nrollup({\n  input: 'main.js',\n  plugins: [ css({dest: 'path-to-my-dir/bundle.css'}) ]\n}).then(bundle =\u003e {\n  bundle.write({\n    format: 'es',\n    file: 'bundle.js'\n  });\n});\n```\n\n### Case 4:\n\nOutput to a standalone css file with only minified css file.\nThe output destination is the same dir of `'bundle.write(options)'` `options.file`.\n\n```js\nimport { rollup } from 'rollup';\nimport css from 'rollup-plugin-css-porter';\n\nrollup({\n  input: 'main.js',\n  plugins: [ css({raw: false}) ]\n}).then(bundle =\u003e {\n  bundle.write({\n    format: 'es',\n    file: 'bundle.js'\n  });\n});\n```\n\n### Case 5:\n\nCustom output filenames by config a string value for plugin `raw` and `minified` option :\n\n```js\nimport { rollup } from 'rollup';\nimport css from 'rollup-plugin-css-porter';\n\nrollup({\n  input: 'main.js',\n  plugins: [ css({\n    raw: 'custom.css',\n    minified: 'custom.min.css',\n  }) ]\n}).then(bundle =\u003e {\n  bundle.write({\n    format: 'es',\n    file: 'bundle.js'\n  });\n});\n```\n\nOr:\n\n```js\ncss({\n  raw: 'custom.css',\n  minified: false,\n})\n```\n\nOr:\n\n```js\ncss({\n  raw: false,\n  minified: 'custom.min.css',\n})\n```\n\n## Build\n\nUse `npm`:\n\n```bash\nnpm run build\n```\n\nUse `yarn`:\n\n```bash\nyarn run build\n```\n\n## Run test\n\nUse `npm`:\n\n```bash\nnpm test\n```\n\nUse `yarn`:\n\n```bash\nyarn test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRJHwang%2Frollup-plugin-css-porter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRJHwang%2Frollup-plugin-css-porter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRJHwang%2Frollup-plugin-css-porter/lists"}