CSS, SASS, LESS bundle for gulp-flow.
- gulp-flow must be installed.
npm install --save-dev gulp-flow-css
or
yarn add --dev gulp-flow-css
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.
A common use case:
'use strict';
require('gulp-flow-css');
// build: CSS
gulp.task('build.css', function() {
return gulp.src(cfg.css.src)
.pipe(gp.newer(cfg.publicCssDir))
// .pipe(gp.using())
.pipe(gp.ifElse(
envList.NODE_ENV === 'production',
pipes.prodCssBundle,
pipes.devCssBundle
))
.pipe(gulp.dest(cfg.publicCssDir))
;
});
And run your tasks: APP_ENV=dev gulp
MIT (c) 2016, Nicolas Tallefourtane.
Nicolas Talle |