Bring in babel for modern JS

This commit is contained in:
Pradyun Gedam 2021-07-25 14:50:11 +01:00
parent 1b2613e174
commit ae64df7f08
No known key found for this signature in database
GPG Key ID: FF99710C4332258E
3 changed files with 1447 additions and 1 deletions

View File

@ -3,6 +3,7 @@
var gulp = require("gulp");
var concat = require("gulp-concat");
var babel = require("gulp-babel");
var postcss = require("gulp-postcss");
var rename = require("gulp-rename");
var sass = require("gulp-sass");
@ -35,8 +36,13 @@ function javascript() {
return gulp
.src(src_path + "scripts/[!_]*.js", { since: gulp.lastRun(javascript) })
.pipe(sourcemaps.init())
.pipe(concat("scripts/main.js"))
.pipe(
babel({
presets: ["@babel/env"],
})
)
.pipe(uglify())
.pipe(concat("scripts/main.js"))
.pipe(sourcemaps.write(""))
.pipe(gulp.dest(dest_path));
}

1435
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -14,5 +14,10 @@
"postcss": "^7.0.36",
"postcss-easy-import": "^3.0.0",
"sass": "^1.36.0"
},
"devDependencies": {
"@babel/core": "^7.14.8",
"@babel/preset-env": "^7.14.8",
"gulp-babel": "^8.0.0"
}
}