4.0.1 • Published 5 years ago

gulp-csso v4.0.1

Weekly downloads
34,415
License
MIT
Repository
github
Last release
5 years ago

gulp-csso Build Status NPM version Dependency Status

Minify CSS with CSSO.

If you have any difficulties with the output of this plugin, please use the CSSO tracker.

Install

With npm do:

npm install gulp-csso --save-dev

Example

var gulp = require('gulp');
var csso = require('gulp-csso');

gulp.task('default', function () {
    return gulp.src('./main.css')
        .pipe(csso())
        .pipe(gulp.dest('./out'));
});

gulp.task('development', function () {
    return gulp.src('./main.css')
        .pipe(csso({
            restructure: false,
            sourceMap: true,
            debug: true
        }))
        .pipe(gulp.dest('./out'));
});

API

csso(options)

options

For backwards compatibility it can also be a boolean. In this case, the inverted value is set to options.restructure (e.g. true becomes {restructure: false}).

restructure

Type: boolean
Default: true

The default is to use structure minimization for maximum compression. Pass false instead if you want to disable this feature.

sourceMap

Type: boolean
Default: depends on input file has a source map or not

Specify this to generate source map; by default a source map is generated only if the input file has a source map. Pass true to ensure that the source map is generated or false to disable this.

Alternatively, you can enable source maps support using gulp-sourcemaps:

var gulp = require('gulp');
var csso = require('gulp-csso');
var sourcemaps = require('gulp-sourcemaps');

gulp.task('default', function () {
    return gulp.src('main.css')
        .pipe(sourcemaps.init())
        .pipe(csso())
        .pipe(sourcemaps.write('.'))
        .pipe(gulp.dest('./out'));
});
debug

Type: boolean
Default: false

Pass true or a positive number (greater number for more details) to get some debugging information about the minification process.

usage

Type: object Default: null

Usage data for advanced optimisations (read more in the CSSO documentation).

Contributing

Pull requests are welcome. If you add functionality, then please add unit tests to cover it.

License

MIT © Ben Briggs

@webx/gulpgulpproject-v1sw-plugin-dev@crivas/ute-uimy-gulpak-gulpsfcompiler.js@wwwoda/gulp-taskskirpidebox-web-core@dendronhq/dendron-next-server@gabinrimbault/framework-frontend@infinitebrahmanuniverse/nolb-gulp-c@everything-registry/sub-chunk-1806tars-clitars-cli_senja006test-poryfescarletsframe-compilerreactator-buildstatic-buildsx-gulpfile-utilsvoyager-lessvoyager-less-autoprefixervoyager-stylusvoyager-stylus-autoprefixermn-gulpmod-sitelilacslilalaravel-elixir-usereflastcall-gulp-drupal-tasksless-fabricatorjquery-tourerjquery.basliderisomorphicjabher-gulpfilemake-shift-brew-uijufkodhuskumar-audiokumar_intensehf-lentiligem-wikibrickinfinxgulp-elixir-cssmingulp-lightninggulp-pipe-buildergulp-recipe-pipemin-buildgulp-atsgulp-toolbeltgurt-fragsgulp-zkflow-angulargulptasksgulp-tasks-buildkickup-toolkitghost-helmmy_auction_lab3mapbox-gl-map-extractmatthewmueller-duo-bundlelucify-build-toolsoptimus-tars-cliportal.pathwar.netplantingjspotionsocto-buildernw-gulp-tasksnode-build-web-appng1-template-gulppicogenmodern-web-dev-buildmv-buildernweb.jsrefill-angularsprawld-boilerplatesprawld-gulp-boilerplatespringbokjs-basespringbokjs-base-nextsprites-clistatic-site-creatorsmashersmashing-dev-toolsimple-bundlesites@angular-template/ng1-build@angular-template/ng2-template-build@agrarium/builder-xjst@alotool/bl-pack@alotool/blogger-pack@achingbrain/slides3gtel-frontend-platform1000-packages08cms@cmwylie19/infinx@cnbritain/merlin-www-build-tools@deck/presenter@diekoders/resourcesym-builderymbyvideo-timedtext
4.0.1

5 years ago

4.0.0

5 years ago

3.0.1

7 years ago

3.0.0

8 years ago

2.0.0

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

10 years ago

0.2.9

11 years ago

0.2.8

11 years ago

0.2.7

11 years ago

0.2.6

11 years ago

0.2.5

11 years ago

0.2.4

11 years ago

0.2.3

11 years ago

0.2.2

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.8

11 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago