forked from pastorenue/plotly.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
81 lines (55 loc) · 1.96 KB
/
Copy pathgulpfile.js
File metadata and controls
81 lines (55 loc) · 1.96 KB
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
78
79
80
81
// --
// gulp
// --
var gulp = require('gulp');
var shell = require('gulp-shell');
// styles
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
// misc
var plumber = require('gulp-plumber');
var browserSync = require('browser-sync');
var hashsum = require("gulp-hashsum");
var runSequence = require('run-sequence');
// Command line for jekyll
gulp.task('build', shell.task(['jekyll build']));
//gulp.task('build', shell.task(['bundle exec jekyll build --watch']));
// Task for serving with Browsersync
gulp.task('serve', function () {
browserSync.init({server: {baseDir: '_site/'}});
gulp.watch(['_site/**/*.*', '!_site/**/index.html', '!_site/**/*.scss', '!_site/**/*.css']).on('change', browserSync.reload);
});
// Sassy
gulp.task('sass', function() {
gulp.src('scss/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 15 versions'],
cascade: false
}))
.pipe(gulp.dest('_site/styles'))
.pipe(browserSync.stream())
});
// Version Sass
gulp.task('sass_cache', function () {
gulp.src('scss/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 15 versions'],
cascade: false
}))
.pipe(gulp.dest('./styles'))
.pipe(hashsum({filename: './_data/cache_bust_css.yml', hash: 'md5'}))
.pipe(browserSync.stream())
});
// Watch
gulp.task('watch', function() {
gulp.watch('scss/**/*', ['sass']);
browserSync({
proxy: "help.plot.ly.dev", // Set this to whatever you want and then point it to /_site (in mamp or your favorite method)
files: ["_site/*.html"]
});
});
gulp.task('bw', ['build', 'sass', 'watch']);
gulp.task('default', ['sass', 'watch']);
gulp.task('deploy', runSequence('build', 'sass_cache'));