-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
54 lines (39 loc) · 1.46 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
var gulp = require('gulp'),
sass = require('gulp-sass')(require('node-sass')),
jshint= require('gulp-jshint'),
path = require('path'),
shell = require('gulp-shell'),
rename = require('gulp-rename'),
dummy = 'last';
// fix Promise() error from which package again?
require('es6-promise').polyfill();
sass_paths = [
'djangocms_misc/basic/static/admin/djangocms_misc/sass/*.sass',
'djangocms_misc/basic/static/djangocms_misc/sass/*.sass',
'djangocms_misc/autopublisher/static/autopublisher/sass/*.sass',
'djangocms_misc/admin_style/static/admin/djangocms_misc/sass/*.sass',
// 'djangocms_misc/static/djangocms_misc/sass/*.sass'
]
gulp.task('sass', function () {
return gulp.src(sass_paths, { base: '.' })
.pipe(sass({errLogToConsole: true}))
.pipe(rename(function(path) {
path.dirname = path.dirname.replace('/sass', '/css');
path.extname = '.css';
}))
.pipe(gulp.dest('.'));
});
gulp.task('flake8', shell.task(
['flake8 --ignore=errors']
)
);
gulp.task('jshint', function () {
gulp.src(['gulpfile.js', 'djangocms_misc/**.js'])
.pipe(jshint());
});
gulp.task('default', gulp.parallel('sass', 'flake8', 'jshint'));
gulp.task('watch', function () {
gulp.watch('djangocms_misc/**/**.sass', gulp.parallel('sass'));
gulp.watch(['gulpfile.js', 'djangocms_misc/**.js'], gulp.parallel('jshint'));
gulp.watch('**/*.py', gulp.parallel('flake8'));
});