]> git.r.bdr.sh - rbdr/serpentity/blobdiff - gulpfile.js
Merge branch 'release/1.0.0'
[rbdr/serpentity] / gulpfile.js
index 3c4352968cb259e529d7f1df5f22b021921a2fb0..dcb689bf31f06e897f20862c5597e3bba1752355 100644 (file)
@@ -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'));
 });