-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
52 lines (45 loc) · 1.34 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
var gulp = require('gulp');
var sass = require('gulp-sass');
var nunjucksRender = require('gulp-nunjucks-render');
var htmlbeautify = require('gulp-html-beautify');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var cleanCSS = require('gulp-clean-css');
var sassOptions = {
errLogToConsole: true,
outputStyle: 'expanded'
};
gulp.task('sass', function(){
return gulp.src('app/scss/main.scss')
.pipe(sass(sassOptions).on('error', sass.logError))
.pipe(gulp.dest('app/css'))
});
gulp.task('nunjucks', function() {
return gulp.src('app/pages/**/*.+(html|nunjucks)')
.pipe(nunjucksRender({
path: ['app/templates']
}))
.pipe(gulp.dest('docs'))
});
gulp.task('htmlbeautify', function() {
var options = {
indentSize: 4
};
gulp.src('docs/*.html')
.pipe(htmlbeautify(options))
.pipe(gulp.dest('docs'))
});
gulp.task('scripts', function() {
return gulp.src(['app/js/scripts.js', 'app/js/jquery.parallax.js'])
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(gulp.dest('docs/dist'));
});
gulp.task('styles', function(){
return gulp.src('app/css/*.css')
.pipe(cleanCSS())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('docs/dist'))
});
gulp.task('default', ['sass', 'scripts', 'styles', 'nunjucks', 'htmlbeautify']);