-
Notifications
You must be signed in to change notification settings - Fork 73
/
gulpfile.js
34 lines (29 loc) · 844 Bytes
/
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
33
34
const gulp = require('gulp');
const gulpif = require('gulp-if');
const sourcemaps = require('gulp-sourcemaps');
const pump = require('pump');
const util = require('gulp-util');
const production = (util.env.type === 'production');
gulp.task('scripts', cb => {
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
pump([
gulp.src(['layout/scripts.js']),
gulpif(production, uglify()),
rename({ suffix: '.min' }),
gulp.dest('layout'),
], cb);
});
gulp.task('styles', cb => {
const sass = require('gulp-sass');
pump([
gulp.src('./layout/sass/**/[^_]*.sass'),
gulpif(!production, sourcemaps.init()),
sass({
outputStyle: (production) ? 'compressed' : 'expanded',
}),
gulpif(!production, sourcemaps.write()),
gulp.dest('layout'),
], cb);
});
gulp.task('default', ['scripts', 'styles']);