Upgrade to gulp 4.0.

This commit is contained in:
David Molineus
2018-10-29 15:46:38 +01:00
parent 9e54f12555
commit 7ec2ee0d96
4 changed files with 3269 additions and 20 deletions

1
.gitignore vendored
View File

@@ -25,4 +25,3 @@ build.properties
# NPM # NPM
node_modules node_modules
package-lock.json

View File

@@ -1,7 +1,7 @@
var gulp = require('gulp'); const { series, src, watch, dest} = require('gulp');
var del = require('del'); const del = require('del');
var uglify = require('gulp-uglify'); const uglify = require('gulp-uglify');
var concat = require('gulp-concat'); const concat = require('gulp-concat');
var paths = { var paths = {
minified: 'contao-leaflet.js', minified: 'contao-leaflet.js',
@@ -9,20 +9,19 @@ var paths = {
dest: 'src/Bundle/Resources/public/js' dest: 'src/Bundle/Resources/public/js'
}; };
gulp.task('clear', function() { function cleanTask (cb) {
del([paths.dest + '/' + paths.minified]); del([paths.dest + '/' + paths.minified]);
}); cb();
}
gulp.task('scripts', ['clear'], function() { const buildTask = series(cleanTask, function (cb) {
return gulp.src(paths.scripts) return src(paths.scripts)
.pipe(concat(paths.minified)) .pipe(concat(paths.minified))
.pipe(uglify()) .pipe(uglify())
.pipe(gulp.dest(paths.dest)); .pipe(dest(paths.dest));
}); });
exports.clean = cleanTask;
gulp.task('default', ['scripts']); exports.watch = watch(paths.scripts, buildTask);
exports.build = buildTask;
gulp.task('watch', function() { exports.default = buildTask;
gulp.watch(paths.scripts, ['scripts']);
});

3250
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -5,9 +5,10 @@
"main": "gulpfile.js", "main": "gulpfile.js",
"dependencies": { "dependencies": {
"del": "^3.0.0", "del": "^3.0.0",
"gulp": "^3.9.1", "gulp": "^4.0.0",
"gulp-concat": "^2.6.0", "gulp-cli": "^2.0.1",
"gulp-uglify": "^3.0.0" "gulp-concat": "^2.6.1",
"gulp-uglify": "^3.0.1"
}, },
"devDependencies": {}, "devDependencies": {},
"scripts": { "scripts": {
@@ -23,7 +24,7 @@
"Maps" "Maps"
], ],
"author": "netzmacht David Molineus", "author": "netzmacht David Molineus",
"license": "LGPL-3.0", "license": "LGPL-3.0-or-later",
"bugs": { "bugs": {
"url": "https://github.com/netzmacht/contao-leaflet-maps/issues" "url": "https://github.com/netzmacht/contao-leaflet-maps/issues"
}, },