-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
42 lines (35 loc) · 1.19 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
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var cleanCSS = require('gulp-clean-css');
var autoprefixer = require('gulp-autoprefixer');
var uglify = require('gulp-uglify');
var merge = require('merge-stream');
gulp.task('sass', function () {
var baseCssStream = gulp.src('_static/styles/base.scss')
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError));
var normalize = gulp.src('node_modules/normalize.css/normalize.css');
var pygments = gulp.src('_static/styles/pygment.css');
return merge(normalize, pygments, baseCssStream)
.pipe(concat('styles.css'))
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(autoprefixer({browsers: ['last 2 versions'], cascade: false}))
.pipe(gulp.dest('static/css'));
});
gulp.task('scripts', function() {
return gulp.src([
'node_modules/slideout/dist/slideout.js',
'_static/scripts/scripts.js'
])
.pipe(concat('scripts.js'))
.pipe(uglify())
.pipe(gulp.dest('static/js'));
});
gulp.task('images', function() {
return gulp.src([
'_static/images/*'
])
.pipe(gulp.dest('static/images'));
});
gulp.task('default', ['sass', 'scripts', 'images']);