项目作者: gulp-flow

项目描述 :
CSS, SASS, LESS bundle for gulp-flow.
高级语言: JavaScript
项目地址: git://github.com/gulp-flow/gulp-flow-css.git
创建时间: 2019-05-06T16:22:14Z
项目社区:https://github.com/gulp-flow/gulp-flow-css

开源协议:Other

下载


gulp-flow-css

CSS, SASS, LESS bundle for gulp-flow.

Requirements

Install

  1. npm install --save-dev gulp-flow-css

or

  1. yarn add --dev gulp-flow-css

Usage

By default this bundle is preconfigured in cfg.css.

This module adds some gp (Gulp plugins):

  • gp.postcss
  • gp.cssnano
  • gp.less
  • gp.sass

And pipes:

  • pipes.devSassBundle (NODE_ENV=development)
  • pipes.prodSassBundle (NODE_ENV=production)
  • pipes.devLessBundle (NODE_ENV=development)
  • pipes.prodLessBundle (NODE_ENV=production)
  • pipes.devCssBundle (NODE_ENV=development)
  • pipes.prodCssBundle (NODE_ENV=production)

And push ignored files in cfg.files.

See the source code for more details.

Task

A common use case:

  1. 'use strict';
  2. require('gulp-flow-css');
  3. // build: CSS
  4. gulp.task('build.css', function() {
  5. return gulp.src(cfg.css.src)
  6. .pipe(gp.newer(cfg.publicCssDir))
  7. // .pipe(gp.using())
  8. .pipe(gp.ifElse(
  9. envList.NODE_ENV === 'production',
  10. pipes.prodCssBundle,
  11. pipes.devCssBundle
  12. ))
  13. .pipe(gulp.dest(cfg.publicCssDir))
  14. ;
  15. });

And run your tasks: APP_ENV=dev gulp

LICENSE

MIT (c) 2016, Nicolas Tallefourtane.

Author

Nicolas Tallefourtane - Nicolab.net
Nicolas Talle
Make a donation via Paypal