forked from vmware-archive/pgadmin4-style-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
76 lines (62 loc) · 1.85 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
'use strict';
var autoprefixer = require('gulp-autoprefixer');
var connect = require('gulp-connect');
var gulp = require('gulp');
var open = require('gulp-open');
var os = require('os');
var sass = require('gulp-sass');
var shell = require('gulp-shell');
var sourcemaps = require('gulp-sourcemaps');
var browser = os.platform() === 'linux' ? 'google-chrome' : (
os.platform() === 'darwin' ? 'google chrome' : (
os.platform() === 'win32' ? 'chrome' : 'firefox'));
gulp.task('hologram', shell.task([
'hologram config.yml'
]));
gulp.task('sass', function() {
return gulp
.src('./styles/*.scss')
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./built-styles/css'))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
flexbox: true
}))
});
gulp.task('watch', function(){
gulp.watch(['./styles/*', './styles/_*.scss', './styles/*.md'], ['sass', 'hologram']);
gulp.watch(['./styleguide-dist/*.html', './templates/*.html'], ['html']);
gulp.watch(['./styleguide-theme/**/*'], ['hologram', 'html']);
});
gulp.task('connect', function() {
connect.server({
root: './styleguide-dist',
livereload: true
});
});
gulp.task('open', function() {
gulp.src('./styleguide-dist/index.html')
.pipe(open({
app: browser,
uri: 'http://localhost:8080'
}))
})
gulp.task('html', function () {
gulp.src('./styleguide-dist/*')
.pipe(connect.reload());
});
gulp.task('wraith-capture', shell.task([
'wraith capture test/configs/capture.yaml',
]))
gulp.task('wraith-history', shell.task([
'wraith history test/configs/history.yaml',
]))
gulp.task('wraith-latest', shell.task([
'wraith latest test/configs/history.yaml',
]))
gulp.task('deploy', shell.task([
'cf push'
]));
gulp.task('default', ['open', 'sass', 'hologram', 'connect', 'watch' ])