{"id":13484238,"url":"https://github.com/scniro/gulp-clean-css","last_synced_at":"2025-05-14T20:04:19.024Z","repository":{"id":37550336,"uuid":"52217194","full_name":"scniro/gulp-clean-css","owner":"scniro","description":"Minify css with clean-css.","archived":false,"fork":false,"pushed_at":"2024-03-26T10:26:30.000Z","size":22243,"stargazers_count":649,"open_issues_count":11,"forks_count":61,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-10-29T15:20:49.144Z","etag":null,"topics":["clean-css","gulp"],"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/scniro.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":"2016-02-21T17:01:12.000Z","updated_at":"2023-11-17T15:16:08.000Z","dependencies_parsed_at":"2024-06-18T12:09:38.453Z","dependency_job_id":null,"html_url":"https://github.com/scniro/gulp-clean-css","commit_stats":{"total_commits":125,"total_committers":12,"mean_commits":"10.416666666666666","dds":"0.16000000000000003","last_synced_commit":"7eddd7deabcea03b6c7abb02dd3da128d3c6477f"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scniro%2Fgulp-clean-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scniro%2Fgulp-clean-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scniro%2Fgulp-clean-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scniro%2Fgulp-clean-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scniro","download_url":"https://codeload.github.com/scniro/gulp-clean-css/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248718901,"owners_count":21150657,"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":["clean-css","gulp"],"created_at":"2024-07-31T17:01:21.171Z","updated_at":"2025-04-13T13:24:27.374Z","avatar_url":"https://github.com/scniro.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","插件","Plugins"],"sub_categories":["压缩","Minification"],"readme":"# gulp-clean-css\n\n[![Build Status](https://img.shields.io/travis/scniro/gulp-clean-css.svg?style=flat-square)](https://travis-ci.org/scniro/gulp-clean-css)\n[![Dependency Status](https://img.shields.io/david/scniro/gulp-clean-css.svg?label=deps\u0026style=flat-square)](https://david-dm.org/scniro/gulp-clean-css)\n[![devDependency Status](https://img.shields.io/david/dev/scniro/gulp-clean-css.svg?label=devDeps\u0026style=flat-square)](https://david-dm.org/scniro/gulp-clean-css#info=devDependencies)\n[![Coverage](https://img.shields.io/coveralls/scniro/gulp-clean-css.svg?style=flat-square)](https://coveralls.io/github/scniro/gulp-clean-css)\n[![Downloads](https://img.shields.io/npm/dm/gulp-clean-css.svg?style=flat-square)](https://www.npmjs.com/package/gulp-clean-css)\n[![NPM Version](https://img.shields.io/npm/v/gulp-clean-css.svg?style=flat-square)](https://www.npmjs.com/package/gulp-clean-css)\n[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/alferov/awesome-gulp#minification)\n\n\u003e [gulp](http://gulpjs.com/) plugin to minify CSS, using [clean-css](https://github.com/jakubpawlowicz/clean-css)\n\n## Regarding Issues\n\nThis is just a simple [gulp](https://github.com/gulpjs/gulp) plugin, which means it's nothing more than a thin wrapper around `clean-css`. If it looks like you are having CSS related issues, please contact [clean-css](https://github.com/jakubpawlowicz/clean-css/issues). Only create a new issue if it looks like you're having a problem with the plugin itself.\n\n## Install\n\n```\nnpm install gulp-clean-css --save-dev\n```\n\n## API\n\n### cleanCSS([*options*], [*callback*])\n\n#### options\n\nSee the [`CleanCSS` options](https://github.com/jakubpawlowicz/clean-css#how-to-use-clean-css-api).\n\n```javascript\nconst gulp = require('gulp');\nconst cleanCSS = require('gulp-clean-css');\n\ngulp.task('minify-css', () =\u003e {\n  return gulp.src('styles/*.css')\n    .pipe(cleanCSS({compatibility: 'ie8'}))\n    .pipe(gulp.dest('dist'));\n});\n```\n\n#### callback\n\nUseful for returning details from the underlying [`minify()`](https://github.com/jakubpawlowicz/clean-css#using-api) call. An example use case could include logging `stats` of the minified file. In addition to the default object, `gulp-clean-css` provides the file `name` and `path` for further analysis.\n\n```javascript\nconst gulp = require('gulp');\nconst cleanCSS = require('gulp-clean-css');\n\ngulp.task('minify-css', () =\u003e {\n  return gulp.src('styles/*.css')\n    .pipe(cleanCSS({debug: true}, (details) =\u003e {\n      console.log(`${details.name}: ${details.stats.originalSize}`);\n      console.log(`${details.name}: ${details.stats.minifiedSize}`);\n    }))\n  .pipe(gulp.dest('dist'));\n});\n```\n\n[Source Maps](http://www.html5rocks.com/tutorials/developertools/sourcemaps/) can be generated by using [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps).\n\n```javascript\n\nconst gulp = require('gulp');\nconst cleanCSS = require('gulp-clean-css');\nconst sourcemaps = require('gulp-sourcemaps');\n\ngulp.task('minify-css',() =\u003e {\n  return gulp.src('./src/*.css')\n    .pipe(sourcemaps.init())\n    .pipe(cleanCSS())\n    .pipe(sourcemaps.write())\n    .pipe(gulp.dest('dist'));\n});\n```\n\n## License\n\n[MIT](./LICENSE) © 2020 [scniro](https://github.com/scniro)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscniro%2Fgulp-clean-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscniro%2Fgulp-clean-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscniro%2Fgulp-clean-css/lists"}