X-Git-Url: https://git.r.bdr.sh/rbdr/serpentity/blobdiff_plain/bf8f1394a3b0fc0213ac069aa65b2407f1d0d090..169ee855dda610ea7156fc2269ca483c0a9ae14c:/gulpfile.js?ds=inline diff --git a/gulpfile.js b/gulpfile.js index 3c43529..dcb689b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,10 +1,13 @@ 'use strict'; -let gulp = require('gulp'); -let concat = require('gulp-concat'); +const Gulp = require('gulp'); +const Babel = require('gulp-babel'); +const Concat = require('gulp-concat'); +const Rename = require('gulp-rename'); +const Uglify = require('gulp-uglify'); -gulp.task('build', function() { - gulp.src([ +Gulp.task('build', function() { + Gulp.src([ 'lib/serpentity.js', 'lib/serpentity/entity.js', 'lib/serpentity/node.js', @@ -12,6 +15,14 @@ gulp.task('build', function() { 'lib/serpentity/component.js', 'lib/serpentity/system.js' ]) - .pipe(concat('serpentity.js')) - .pipe(gulp.dest('dist')); + .pipe(Babel({ + presets: ['es2015'] + })) + .pipe(Concat('serpentity.js')) + .pipe(Gulp.dest('dist')) + .pipe(Uglify()) + .pipe(Rename({ + suffix: '.min' + })) + .pipe(Gulp.dest('dist')); });