{"id":17750555,"url":"https://github.com/nuintun/gulp-css","last_synced_at":"2026-01-20T00:33:57.663Z","repository":{"id":31756641,"uuid":"35322812","full_name":"nuintun/gulp-css","owner":"nuintun","description":"A gulp plugin for css transport and concat","archived":false,"fork":false,"pushed_at":"2022-12-03T00:17:22.000Z","size":780,"stargazers_count":1,"open_issues_count":9,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T00:09:59.204Z","etag":null,"topics":["build-tool","build-tools","combine","css","gulp-plugin","gulp-plugins","minify","web","web-performance"],"latest_commit_sha":null,"homepage":"http://nuintun.github.io/gulp-css","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/nuintun.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}},"created_at":"2015-05-09T09:25:24.000Z","updated_at":"2021-07-27T02:08:54.000Z","dependencies_parsed_at":"2023-01-14T19:42:48.428Z","dependency_job_id":null,"html_url":"https://github.com/nuintun/gulp-css","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuintun%2Fgulp-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuintun%2Fgulp-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuintun%2Fgulp-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuintun%2Fgulp-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuintun","download_url":"https://codeload.github.com/nuintun/gulp-css/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247625752,"owners_count":20969165,"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":["build-tool","build-tools","combine","css","gulp-plugin","gulp-plugins","minify","web","web-performance"],"created_at":"2024-10-26T12:22:34.785Z","updated_at":"2026-01-20T00:33:57.625Z","avatar_url":"https://github.com/nuintun.png","language":"JavaScript","readme":"# gulp-css\n\n\u003e A gulp plugin for css transport and concat\n\u003e\n\u003e [![NPM Version][npm-image]][npm-url]\n\u003e [![Download Status][download-image]][npm-url]\n\u003e [![Dependencies][david-image]][david-url]\n\n### Usage\n\n```js\nconst gulp = require('gulp');\nconst css = require('@nuintun/gulp-css');\nconst { join, relative } = require('path');\n\n// Fixed css resource path\nfunction onpath(path, property, file, wwwroot) {\n  if (/^[^./\\\\]/.test(path)) {\n    path = './' + path;\n  }\n\n  if (path.startsWith('.')) {\n    path = join(dirname(file), path);\n    path = relative(wwwroot, path);\n    path = '/' + path;\n    path = path.replace(/\\\\+/g, '/');\n  }\n\n  path = path.replace('assets/', 'online/');\n\n  return path;\n}\n\n// Task\ngulp.task('default', function() {\n  gulp\n    .src('assets/css/**/*.css')\n    .pipe(css({ onpath: onpath }))\n    .pipe(gulp.dest('online/css'));\n});\n```\n\n### API\n\n#### css(options)\n\n##### _options_\n\n- root `String`\n\n  网站根目录。\n\n- map `Function`\n\n  配置模块 `ID` 映射（返回的映射字符串必须符合文件路径规则，会同步更新模块 `ID` 和 输出文件名）。\n\n- combine `Boolean|Function`\n\n  是否合并样式。\n\n- onpath `Function`\n\n  样式文件中的资源文件路径处理回调函数。\n\n- onbundle `Function`\n\n  模块合并完成后回调函数。\n\n- plugins `Array[Object]`\n\n  自定义模块转换插件，有 `moduleDidLoaded, moduleDidParsed, moduleDidCompleted` 三个生命周期提供调用处理。\n\n[npm-image]: http://img.shields.io/npm/v/@nuintun/gulp-css.svg?style=flat-square\n[npm-url]: https://www.npmjs.org/package/@nuintun/gulp-css\n[download-image]: http://img.shields.io/npm/dm/@nuintun/gulp-css.svg?style=flat-square\n[david-image]: http://img.shields.io/david/nuintun/gulp-css.svg?style=flat-square\n[david-url]: https://david-dm.org/nuintun/gulp-css\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuintun%2Fgulp-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuintun%2Fgulp-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuintun%2Fgulp-css/lists"}