1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | module.exports = function(gulp, $, conf, browserSync) {
|
8 | gulp.task('styles', function() {
|
9 | var compress = conf.build.compress !== true ? !!conf.build.compress.css : true;
|
10 | return gulp.src(conf.parsePwd(conf.styleFiles), { base: conf.parsePwd(conf.app) })
|
11 | .pipe($.if(!conf.isProduction, $.sourcemaps.init()))
|
12 | .pipe($.less()).on('error', conf.errorHandler('Less'))
|
13 | .pipe($.autoprefixer()).on('error', conf.errorHandler('Autoprefixer'))
|
14 | .pipe($.if(conf.isProduction && compress, $.cleanCss({compatibility: conf.build.compatibility})))
|
15 | .pipe($.if(!conf.isProduction, $.sourcemaps.write()))
|
16 | .pipe(gulp.dest(conf.parsePwd(conf.tmp)))
|
17 | .pipe(browserSync.stream());
|
18 | });
|
19 | }
|