forked from isotope/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
69 lines (62 loc) · 1.56 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
'use strict';
var path = require('path');
var gulp = require('gulp'),
csso = require('gulp-csso'),
ignore = require('gulp-ignore'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify'),
pump = require('pump');
// Configuration
const scripts = [
'system/modules/isotope/assets/js/*.js',
'!system/modules/isotope/assets/js/*.min.js'
];
const styles = [
'system/modules/isotope/assets/css/isotope.css',
'!system/modules/isotope/assets/css/*.min.css',
'system/modules/isotope_reports/assets/*.css',
'!system/modules/isotope_reports/assets/*.min.css'
];
gulp.task('scripts', function (cb) {
pump(
[
gulp.src(scripts),
ignore.exclude('*.min.js'),
uglify(),
rename({
suffix: '.min'
}),
gulp.dest('system/modules/isotope/assets/js')
],
cb
);
});
gulp.task('styles', function (cb) {
pump(
[
gulp.src(styles),
ignore.exclude('*.min.css'),
csso({
comments: false,
restructure: false
}),
rename({
suffix: '.min'
}),
// gulp.dest('.')
gulp.dest( function( file ) { return path.dirname(file.path) } )
],
cb
);
});
gulp.task('watch', function () {
gulp.watch(
scripts,
gulp.series('scripts')
);
gulp.watch(
styles,
gulp.series('styles')
);
});
gulp.task('default', gulp.parallel('scripts', 'styles'));