Added Babel transpilation support to the gulp workflow
This commit is contained in:
parent
e979f08215
commit
70625e37a5
4 changed files with 1474 additions and 8 deletions
3
babel.config.json
Normal file
3
babel.config.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"presets": ["@babel/preset-env"]
|
||||
}
|
20
gulpfile.js
20
gulpfile.js
|
@ -9,15 +9,16 @@
|
|||
* @since v1.4.0
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
const babel = require('gulp-babel');
|
||||
const changed = require('gulp-changed');
|
||||
const childProcess = require('child_process');
|
||||
const sass = require('gulp-sass')(require('sass'));
|
||||
const css = require('gulp-clean-css');
|
||||
const del = require('del');
|
||||
const fs = require('fs-extra');
|
||||
const gulp = require('gulp');
|
||||
const plumber = require('gulp-plumber');
|
||||
const rename = require('gulp-rename');
|
||||
const sass = require('gulp-sass')(require('sass'));
|
||||
const uglify = require('gulp-uglify');
|
||||
const zip = require('zip-dir');
|
||||
|
||||
|
@ -82,13 +83,16 @@ function clean(done) {
|
|||
}
|
||||
|
||||
function scripts() {
|
||||
return gulp
|
||||
.src(['assets/js/**/*.js', '!assets/js/**/*.min.js'])
|
||||
.pipe(plumber())
|
||||
.pipe(changed('assets/js/**/*'))
|
||||
.pipe(uglify().on('error', console.log))
|
||||
.pipe(rename({suffix: '.min'}))
|
||||
.pipe(gulp.dest('assets/js'));
|
||||
return (
|
||||
gulp
|
||||
.src(['assets/js/**/*.js', '!assets/js/**/*.min.js'])
|
||||
.pipe(plumber())
|
||||
.pipe(changed('assets/js/**/*'))
|
||||
.pipe(babel())
|
||||
// .pipe(uglify().on('error', console.log))
|
||||
.pipe(rename({suffix: '.min'}))
|
||||
.pipe(gulp.dest('assets/js'))
|
||||
);
|
||||
}
|
||||
|
||||
function styles() {
|
||||
|
|
1456
package-lock.json
generated
1456
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -37,9 +37,12 @@
|
|||
"trumbowyg": "^2.21.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.16.0",
|
||||
"@babel/preset-env": "^7.16.0",
|
||||
"del": "^6.0.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-babel": "^8.0.0",
|
||||
"gulp-changed": "^3.2.0",
|
||||
"gulp-clean-css": "^3.10.0",
|
||||
"gulp-debug": "^4.0.0",
|
||||
|
|
Loading…
Reference in a new issue