Skip to content
Snippets Groups Projects
Commit e5fbb17fbb8a authored by Cédric Krier's avatar Cédric Krier :atom:
Browse files

Minify JS and add source map

parent 12ac053c5072
No related branches found
No related tags found
No related merge requests found
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var sass = require('gulp-sass');
var cleanCSS = require('gulp-clean-css');
......@@ -8,12 +9,12 @@
gulp.task('js', function() {
gulp.src([
'node_modules/jquery/dist/jquery.slim.min.js',
'node_modules/popper.js/dist/umd/popper.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/wowjs/dist/wow.min.js',
'node_modules/jquery/dist/jquery.slim.js',
'node_modules/popper.js/dist/umd/popper.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'node_modules/wowjs/dist/wow.js',
'node_modules/leaflet/dist/leaflet.js',
'js/wow.js',
'js/highlight.pack.js',
'js/highlight.js',
'js/map.js'])
......@@ -15,6 +16,8 @@
'node_modules/leaflet/dist/leaflet.js',
'js/wow.js',
'js/highlight.pack.js',
'js/highlight.js',
'js/map.js'])
.pipe(sourcemaps.init())
.pipe(gulp.dest('static/js/'))
.pipe(concat('all.js'))
......@@ -20,4 +23,6 @@
.pipe(concat('all.js'))
.pipe(uglify())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('static/js/'));
});
......
......@@ -13,6 +13,7 @@
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.1.0",
"gulp-sourcemaps": "^2.6.4",
"gulp-uglify": "^3.0.1",
"html5shiv": "^3.7.3",
"jquery": "^3.3.1",
"leaflet": "^1.3.4",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment