/
scripts.js
64 lines (59 loc) · 1.89 KB
/
scripts.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
const config = require('config')
const { src, dest, parallel, series } = require('gulp')
const concat = require('gulp-concat')
const babel = require('gulp-babel')
const minify = require('gulp-minify')
const SOURCE_ALPINE = config.get('source.alpine_js')
const NAME_ALPINE = config.get('name.alpine_js')
const DESTINATION_ALPINE = config.get('destination.alpine_js')
const SOURCE_PLUGIN_JS = config.get('source.plugin_js')
const NAME_PLUGIN_JS = config.get('name.plugin_js')
const DESTINATION_PLUGIN_JS = config.get('destination.plugin_js')
const SOURCE_PLUGIN_ALPINE_JS = config.get('source.plugin_alpine_js')
const NAME_PLUGIN_ALPINE_JS = config.get('name.plugin_alpine_js')
const DESTINATION_PLUGIN_ALPINE_JS = config.get('destination.plugin_alpine_js')
const alpine_js = () => {
return src(SOURCE_ALPINE)
.pipe(concat(NAME_ALPINE))
.pipe(
minify({
ext: {
min: '.min.js',
},
ignoreFiles: ['.min.js'],
})
)
.pipe(dest(DESTINATION_ALPINE))
}
const ta_script = () => {
return src(SOURCE_PLUGIN_JS)
.pipe(
babel({
presets: ['@babel/env'],
})
)
.pipe(concat(NAME_PLUGIN_JS))
.pipe(
minify({
ext: {
min: '.min.js',
},
ignoreFiles: ['.min.js'],
})
)
.pipe(dest(DESTINATION_PLUGIN_JS))
}
const ta_script_alpine = () => {
return src(SOURCE_PLUGIN_ALPINE_JS)
.pipe(concat(NAME_PLUGIN_ALPINE_JS))
.pipe(
minify({
ext: {
min: '.min.js',
},
ignoreFiles: ['.min.js'],
})
)
.pipe(dest(DESTINATION_PLUGIN_ALPINE_JS))
}
module.exports.scripts = series(parallel(alpine_js, ta_script), ta_script_alpine)