-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
56 lines (50 loc) · 1.78 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
53
54
55
56
var gulp = require('gulp'),
plumber = require('gulp-plumber'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
autoprefixer = require('gulp-autoprefixer'),
jade = require('gulp-jade'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
livereload = require('gulp-livereload'),
inlinecss = require('gulp-inline-css');
/* CSS */
gulp.task('styles', function() {
gulp.src('blender-coders/src/styles/**/*.sass')
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(sass({
outputStyle: 'compressed'}
))
.pipe(autoprefixer("last 3 version", "safari 5", "ie 8", "ie 9"))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('blender-coders/static/assets/css'))
.pipe(livereload());
});
/* Inline CSS */
gulp.task('inlinecss', function() {
return gulp.src('blender-coders/templates/widgets/*.html')
.pipe(inlinecss({
applyStyleTags: true,
applyLinkTags: true,
removeStyleTags: true,
removeLinkTags: true
}))
.pipe(gulp.dest('blender-coders/templates/widgets'));
});
/* Templates - Jade */
gulp.task('templates', function() {
gulp.src('blender-coders/src/templates/**/*.jade')
.pipe(jade({
pretty: false
}))
.pipe(gulp.dest('blender-coders/templates'))
.pipe(livereload());
});
gulp.task('watch',function() {
livereload.listen();
gulp.watch('blender-coders/src/styles/**/*.sass',['styles']);
gulp.watch('blender-coders/src/templates/**/*.jade',['templates']);
// gulp.watch('blender-coders/templates/widgets/*.html',['inlinecss']);
});
gulp.task('default', ['styles', 'templates']);