-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
57 lines (53 loc) · 1.62 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
const { src, dest, watch, parallel } = require('gulp');
const minify = require('gulp-minify');
const concat = require('gulp-concat');
function js() {
return src('resources/js/app/*.js', {sourcemaps: true})
.pipe(concat('app.js'))
.pipe(minify({
ext: {
min: '.min.js'
},
}))
.pipe(dest('public/js', { sourcemaps: false }))
}
function dashboardJs() {
return src('resources/js/dashboard/**/*.js', { sourcemaps: true })
.pipe(concat('dashboard.js'))
.pipe(minify({
ext: {
min: '.min.js'
},
}))
.pipe(dest('public/js', { sourcemaps: false }))
}
function DavatJs() {
return src('resources/davat/js/dashboard/**/*.js', { sourcemaps: true })
.pipe(concat('davat.dashboard.js'))
.pipe(minify({
ext: {
min: '.min.js'
},
}))
.pipe(dest('public/js', { sourcemaps: false }))
}
function sampleEngine() {
return src('resources/js/sampleEngine.js', { sourcemaps: true })
.pipe(concat('sampleEngine.js'))
.pipe(minify({
ext: {
min: '.min.js'
},
}))
.pipe(dest('public/js', { sourcemaps: false }))
}
function watchFile()
{
watch('resources/js/app/*.js', js);
watch('resources/js/dashboard/**/*.js', dashboardJs);
watch('resources/davat/js/dashboard/**/*.js', DavatJs);
watch('resources/js/sampleEngine.js', sampleEngine);
}
exports.js = js;
exports.watchFile = watchFile;
exports.default = parallel(js, dashboardJs, DavatJs, sampleEngine, watchFile);