{"id":16925351,"url":"https://github.com/yinxulai/rollup-plugin-less","last_synced_at":"2026-01-31T20:33:45.152Z","repository":{"id":44003968,"uuid":"237989005","full_name":"yinxulai/rollup-plugin-less","owner":"yinxulai","description":"rollup 插件，转换 less 语法，支持 cssModule，css 嵌入（支持 SSR）","archived":false,"fork":false,"pushed_at":"2023-01-07T14:25:26.000Z","size":251,"stargazers_count":3,"open_issues_count":8,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2025-08-09T00:41:10.324Z","etag":null,"topics":["cssmodule","insert","less","plugin","rollup","ssr","ts","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yinxulai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-03T14:49:02.000Z","updated_at":"2020-03-18T01:50:21.000Z","dependencies_parsed_at":"2023-02-07T10:15:52.031Z","dependency_job_id":null,"html_url":"https://github.com/yinxulai/rollup-plugin-less","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yinxulai/rollup-plugin-less","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinxulai%2Frollup-plugin-less","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinxulai%2Frollup-plugin-less/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinxulai%2Frollup-plugin-less/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinxulai%2Frollup-plugin-less/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yinxulai","download_url":"https://codeload.github.com/yinxulai/rollup-plugin-less/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinxulai%2Frollup-plugin-less/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28953676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T18:30:42.805Z","status":"ssl_error","status_checked_at":"2026-01-31T18:30:19.593Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cssmodule","insert","less","plugin","rollup","ssr","ts","typescript"],"created_at":"2024-10-13T20:10:25.213Z","updated_at":"2026-01-31T20:33:45.120Z","avatar_url":"https://github.com/yinxulai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rollup-plugin-less\n\n一个 `Rollup` 插件，用来处理 `less` 引用，支持将 `css` 内置进 `js`，同时支持 `ssr`，支持 `cssModule`\n\n## Installation\n\n```\nnpm install --save-dev @yinxulai/rollup-plugin-less\n```\n\n## Usage\n\n```js\nimport { rollup } from 'rollup'\nimport less from '@yinxulai/rollup-plugin-less'\n// const { rollup } = require('rollup')\n// const less = require('@yinxulai/rollup-plugin-less')\n\nrollup({\n    input: 'src/index.js',\n    plugins: [less(options)],\n}).then(/* ... */)\n```\n**OR**\n\n```js\n// rollup.config.js\nimport less from '@yinxulai/rollup-plugin-less'\n// const less = require('@yinxulai/rollup-plugin-less')\n\nexport default {\n  entry: 'entry.js',\n  dest: 'bundle.js',\n  plugins: [\n    less({options}) // will output compiled styles to bundle.css\n  ]\n}\n```\n\n### Configuration\n\n#### `insert` boolean \n\n将编译后的 css，namedObject 内嵌入 js 里，使模块的使用者\n无需手动 import css 文件，同时对 ssr 支持友好，默认 `false`\n\n#### `include` string[]\n\n include 用来设置仅进行处理的文件\n\n#### `exclude` string[]\n\n exclude 用来设置需要忽略处理的文件\n\n#### `cssModule` object | bool\n\n 本插件使用 `postcss-modules` 插件来处理 `cssModule`\n 同时完整支持 `postcss-modules` 插件配置，具体请查看\n [postcss-modules 文档](https://github.com/css-modules/postcss-modules)\n\n```ts\ninterface CssModuleOptions {\n  scopeBehaviour?: 'global' | 'local'\n  globalModulePaths?: (RegExp | string)[]\n  generateScopedName?: string | GenerateScopedNameFunction\n  hashPrefix?: string\n  camelCase?: boolean\n  root?: string\n}\n```\n\n#### `lessOptions` object\n 本插件使用 `less` 包来对 `less` 文件进行预处理，同时完整支持 `less` 的相关配置\n 详细信息查看 [less 文档](https://github.com/less/less-docs/blob/master/content/usage/less-options.md)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinxulai%2Frollup-plugin-less","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyinxulai%2Frollup-plugin-less","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinxulai%2Frollup-plugin-less/lists"}