Bring in babel for modern JS
This commit is contained in:
parent
1b2613e174
commit
ae64df7f08
|
@ -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));
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue