-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
32 lines (28 loc) · 1 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// https://github.com/sindresorhus/gulp-autoprefixer
const autoprefixer = require('gulp-autoprefixer');
// https://github.com/gulpjs/gulp
const gulp = require('gulp');
// https://github.com/hparra/gulp-rename
const rename = require('gulp-rename');
// https://github.com/dlmanning/gulp-sass
const sass = require('gulp-sass');
// https://github.com/ubirak/gulp-uglifycss
const uglifycss = require('gulp-uglifycss');
// https://github.com/grncdr/merge-stream
const merge = require('merge-stream');
const CONFIGS = [
require('./gulp.config.foo'),
require('./gulp.config.bar')
];
function css() {
const tasks = CONFIGS.map(config => {
return gulp.src(config.css.sourcePaths)
.pipe(sass(config.thirdParty.sassOptions).on('error', sass.logError))
.pipe(autoprefixer())
.pipe(uglifycss(config.thirdParty.uglifyCssOptions))
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest(config.css.exportPath))
});
return merge(tasks);
}
exports.build = css;