-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
49 lines (44 loc) · 1.08 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
/* eslint-disable no-undef */
/*jshint esversion:6 */
/**
* USE with
*
* gulp init - Concatenates Abrantes with the plugins in this Gulpfile
* gulp minify - Minifies Abrantes and the plugins
*
*
*/
// eslint-disable-next-line no-unused-vars
const { src, dest, series, watch } = require('gulp');
const concat = require('gulp-concat');
const terser = require('gulp-terser');
const rename = require('gulp-rename');
/**
* It will concatenate Abrantes with the plugins in the src of this function
*/
function init() {
return src([
'Abrantes.js',
'plugins/ga4-gtag.js',
// 'plugins/matomo.js',
'plugins/hotjar.js',
// 'plugins/clarity.js',
'plugins/formtrack.js',
'plugins/add2DL.js',
])
.pipe(concat("AbrantesPlus.js"))
.pipe(dest('./'));
}
/**
* Minifies the file wih Abrantes and the plugins
*/
function minify() {
return src([
'AbrantesPlus.js',
])
.pipe(terser())
.pipe(rename({ suffix: ".min" }))
.pipe(dest('./'));
}
exports.init = init;
exports.minify = minify;