forked from forgemedia/uGraphics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
75 lines (64 loc) · 1.73 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
'use strict';
let Gulp = require('gulp');
let Nodemon = require('gulp-nodemon');
let Env = require('gulp-env');
let Sass = require('gulp-sass');
let PostCSS = require('gulp-postcss');
let Clean = require('gulp-clean');
let Cssnext = require('postcss-cssnext');
let Cssnano = require('cssnano');
let FS = require('fs');
let Config = require('./config');
Gulp.task('dashcss', () => {
return Gulp.src('./core/scss/dash.scss')
.pipe(Sass({
prefix: '/css',
includePaths: Config.frontend.sassIncludePaths
}))
.pipe(PostCSS([
Cssnext({
browsers: Config.frontend.browserSupport
}),
Cssnano({
autoprefixer: false
})
]))
.pipe(Gulp.dest('./core/assets/css/'));
});
Gulp.task('watchscss', () => Gulp.watch('./core/scss/*.scss', Gulp.series('dashcss')));
Gulp.task('rundbg', () => {
Env({
vars: {
UGR_ENV: 'debug'
}
});
Nodemon({
ext: 'js es6 json',
watch: '.',
exec: 'node index',
ignore: [
'assets',
'jspm_packages',
'node_modules',
'package.json',
'gulpfile.js',
'varsity18',
'core',
'output'
],
restartable: false
});
});
Gulp.task('clean', () => {
return Gulp.src([
'output/',
'*.log',
'server-*',
'core/assets/css/',
'node_modules/',
'jspm_packages/'
], { read: false, allowEmpty: true }).pipe(Clean());
});
Gulp.task('build', Gulp.parallel('dashcss'));
Gulp.task('debug', Gulp.series('build', Gulp.parallel('watchscss', 'rundbg')));
Gulp.task('default', Gulp.series('debug'));