forked from netzmacht/contao-leaflet-maps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (29 loc) · 826 Bytes
/
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
const { series, src, watch, dest, parallel, task} = require('gulp');
const del = require('promised-del');
const uglify = require('gulp-uglify');
const concat = require('gulp-concat');
var paths = {
minified: 'contao-leaflet.js',
scripts: ['js/vendor/*.js', 'js/*.js'],
dest: 'src/Bundle/Resources/public/js'
};
function clean () {
return del([paths.dest + '/' + paths.minified]);
}
function build () {
return src(paths.scripts)
.pipe(concat(paths.minified))
.pipe(uglify())
.pipe(dest(paths.dest));
}
const buildTasks = series(clean, build);
function watchTask () {
watch(
paths.scripts,
buildTasks
)
}
exports.clean = clean;
exports.watch = watchTask;
exports.build = buildTasks;
exports.default = buildTasks;