-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (30 loc) · 1.24 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
// ================ Dependencies for dev & prod ==================
const { src, dest, series } = require('gulp');
const depUglify = require('gulp-uglify');
const depRename = require('gulp-rename');
// ================ Dependencies for dev =========================
// ================ Dependencies for prod ========================
const depStripDebug = require('gulp-strip-debug');
// ================ End Dependencies =============================
// ===============================================================
exports.prod = prod_tasks();
// ================ Dev Tasks (in order: top to bottom) ==========
// ================ Prod Tasks (in order: top to bottom) =========
function prod_tasks() {
return series(
process_index_to_prod
);
}
function process_index_to_prod() {
console.log(' ----- Start: ', get_current_function_name());
return src('index.js')
.pipe(depStripDebug())
.pipe(depUglify())
.pipe(depRename({ extname: '.min.js' }))
.pipe(dest('.'));
}
// ================ Misc Tasks / Functions ======================
function get_current_function_name() {
// The following CAN'T work with strict mode due to security issues
return get_current_function_name.caller.name;
}