Skip to content

Commit

Permalink
Merge pull request #159 from fabiocaccamo/es6
Browse files Browse the repository at this point in the history
Switch from ES5 to ES6 syntax.
  • Loading branch information
fabiocaccamo authored Jan 18, 2025
2 parents eb26308 + 213dd09 commit a611c4f
Show file tree
Hide file tree
Showing 79 changed files with 9,110 additions and 11,055 deletions.
27 changes: 8 additions & 19 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
'use strict';

import browser from 'browser-sync';
import gulp from 'gulp';
import jsImport from 'gulp-js-import';
import minify from 'gulp-minify';
import plugins from 'gulp-load-plugins';
import { rimraf } from 'rimraf';
Expand All @@ -18,29 +15,21 @@ const PORT = 8000;
const PRODUCTION = !!yargs.argv.production;

function clean(done) {
rimraf(PATHS.dist, {}).then(function () {
done();
});
rimraf(PATHS.dist, {}).then(() => done());
}

function copy() {
return gulp.src(PATHS.assets).pipe(gulp.dest(PATHS.dist));
}

function javascript() {
return (
gulp
.src(PATHS.javascript)
.pipe($.if(!PRODUCTION, $.sourcemaps.init()))
.pipe($.concat('utils.js'))
.pipe(jsImport({ hideConsole: true }))
// .pipe($.if(PRODUCTION, $.uglify()
// .on('error', e => { console.log(e.message, e.fileName, e.lineNumber); })
// ))
.pipe($.if(!PRODUCTION, $.sourcemaps.write()))
.pipe(minify({ ext: { min: '.min.js' } }))
.pipe(gulp.dest(PATHS.dist))
);
return gulp
.src(PATHS.javascript)
.pipe($.if(!PRODUCTION, $.sourcemaps.init()))
.pipe($.concat('utils.js'))
.pipe($.if(!PRODUCTION, $.sourcemaps.write()))
.pipe(minify({ ext: { min: '.min.js' } }))
.pipe(gulp.dest(PATHS.dist));
}

function server(done) {
Expand Down
Loading

0 comments on commit a611c4f

Please sign in to comment.