-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
58 lines (54 loc) · 1.45 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
const gulp = require('gulp'),
less = require('gulp-less'),
path = require('path'),
minifyCSS = require('gulp-minify-css'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
autoprefixer = require('gulp-autoprefixer'),
eslint = require('gulp-eslint');
gulp.task('watch', () => {
gulp.watch([
'./gui/assets/css/src/**/*.less',
'./gui/assets/js/src/**/*.js'
], gulp.parallel([
'less',
'js'
]));
});
gulp.task('less', () => {
return gulp.src('./gui/assets/css/src/app.less')
.pipe(less({
paths: [path.join(__dirname, 'less', 'includes')]
}))
.pipe(gulp.dest('./gui/assets/css'))
.pipe(autoprefixer())
.pipe(minifyCSS())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./gui/assets/css'));
});
gulp.task('js', () => {
return gulp.src([
'./gui/assets/js/src/vendor/codemirror.min.js',
'./gui/assets/js/src/vendor/codemirror-js.min.js',
'./gui/assets/js/src/vendor/beautify.js',
'./gui/assets/js/src/vendor/socket.io.min.js',
'./gui/assets/js/src/custom/helper.js',
'./gui/assets/js/src/custom/code-editor.js',
'./gui/assets/js/src/custom/import.js',
'./gui/assets/js/src/custom/blueprint.js'
])
.pipe(eslint())
.pipe(concat('app.js'))
.pipe(gulp.dest('./gui/assets/js/'))
.pipe(uglify())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./gui/assets/js/'));
});
gulp.task('default', gulp.series(['less', 'js', 'watch'], (done) => {
return done();
}));