forked from froala/design-blocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
77 lines (66 loc) · 1.98 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
var gulp = require('gulp');
var watch = require('gulp-watch');
var sass = require('gulp-sass');
var copy = require('gulp-copy');
var connect = require('gulp-connect');
var del = require('del');
var vinylPaths = require('vinyl-paths');
var utils = require('./utils');
var build = function (dest) {
gulp.task('clean-' + dest, function () {
del.sync('dist/**/*');
})
gulp.task('sass-' + dest, function () {
gulp.src(['src/scss/froala_blocks.scss'])
.pipe(sass())
.pipe(gulp.dest(dest + '/css'))
});
gulp.task('html-' + dest, function () {
gulp.src(['src/html/**/*.html'])
.pipe(gulp.dest(dest))
})
gulp.task('imgs-' + dest, function () {
gulp.src(['src/imgs/**/*'])
.pipe(gulp.dest(dest + '/imgs'))
})
}
build('demo');
build('dist');
gulp.task('watch', [], function() {
watch('dist').pipe(connect.reload());
watch('src/html', function () {
gulp.start(['html-demo']);
})
watch('src/imgs', function () {
gulp.start(['imgs-demo']);
})
watch('src/scss', function () {
gulp.start(['sass-demo']);
});
})
gulp.task('connect', function () {
connect.server({
root: ['demo', 'node_modules', 'screenshots'],
port: 8001,
livereload: true
});
});
gulp.task('screenshots', function(cb) {
del.sync('./screenshots');
utils.makeScreenshots([
['call_to_action', 'header, section, footer'],
['contacts', 'header, section, footer'],
['contents', 'header, section, footer'],
['features', 'header, section, footer'],
['footers', 'header, section, footer'],
['forms', 'header, section, footer'],
['headers', 'header, section, footer'],
['pricings', 'header, section, footer'],
['teams', 'header, section, footer'],
['testimonials', 'header, section, footer'],
]).then(function() {
cb();
});
});
gulp.task('dist', ['clean-dist', 'html-dist', 'imgs-dist', 'sass-dist']);
gulp.task('default', ['clean-demo', 'html-demo', 'imgs-demo', 'sass-demo', 'connect', 'watch']);