-
Notifications
You must be signed in to change notification settings - Fork 21
/
gulpfile.js
54 lines (45 loc) · 1.21 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
const { watch, series, src, dest } = require('gulp');
const concat = require('gulp-concat');
const cssmin = require('gulp-cssmin');
const rename = require('gulp-rename');
const uglify = require('gulp-uglify');
function defaultTask(cb) {
watch('assets/js/src/*.js', dev);
cb();
}
function dist(cb) {
src(
[
'assets/js/src/sis.js',
'assets/js/src/attachments.js',
'assets/js/src/featured.js'
], { sourcemaps: true }
)
.pipe(uglify())
.pipe(concat('app.min.js', {sourceRoot: '../../'}))
.pipe(dest('assets/js/dist/', { sourcemaps: '.' }));
src(
[
'assets/css/sis-style.css'
]
)
.pipe(cssmin())
.pipe(rename({'suffix': '.min'}))
.pipe(dest('assets/css/'));
cb();
}
function dev(cb) {
src(
[
'assets/js/src/sis.js',
'assets/js/src/attachments.js',
'assets/js/src/featured.js'
], { sourcemaps: true }
)
.pipe(concat('app.js', {sourceRoot: '../../'}))
.pipe(dest('assets/js/dist/', { sourcemaps: '.' }));
cb();
}
exports.default = defaultTask
exports.dist = dist;
exports.dev = dev;