diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-10-17 23:09:34 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-10-17 23:09:34 +0200 |
commit | 417d4b253d2daea0ef3c437c5b3d5eda6ccc7525 (patch) | |
tree | 1b5e6528df2cd679af07e4ffc44c177ed35dac68 /gulpfile.js | |
parent | 8db39b099ea85d881f5e4d12b2b2182d41414da4 (diff) | |
download | svg.js-417d4b253d2daea0ef3c437c5b3d5eda6ccc7525.tar.gz svg.js-417d4b253d2daea0ef3c437c5b3d5eda6ccc7525.zip |
add babel, satisfy linter, build dist
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gulpfile.js b/gulpfile.js index cd573e2..0f140f9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,7 +9,9 @@ var del = require('del'), uglify = require('gulp-uglify'),
wrapUmd = require('gulp-wrap'),
pkg = require('./package.json'),
- standard = require('gulp-standard')
+ standard = require('gulp-standard'),
+ babel = require('gulp-babel'),
+ sourcemaps = require('gulp-sourcemaps')
var headerLong = ['/*!',
'* <%= pkg.name %> - <%= pkg.description %>',
@@ -82,14 +84,10 @@ var parts = [ 'src/boxes.js',
'src/parser.js',
'src/animator.js',
- //
- //
- //
- // TODO: ADD THESE
- //
- // 'src/morph.js',
- // 'src/runner.js'
- // 'src/timeline.js'
+ 'src/morph.js',
+ 'src/runner.js',
+ 'src/timeline.js',
+ 'src/controller.js'
]
gulp.task('clean', function () {
@@ -114,12 +112,15 @@ gulp.task('lint', function () { gulp.task('unify', ['clean', 'lint'], function () {
pkg.buildDate = Date()
return gulp.src(parts)
+ .pipe(sourcemaps.init())
.pipe(concat('svg.js', { newLine: '\n' }))
+ .pipe(babel({presets: ['@babel/env']}))
// wrap the whole thing in an immediate function call
.pipe(wrapUmd({src: 'src/umd.js'}))
.pipe(header(headerLong, { pkg: pkg }))
.pipe(trim({ leading: false }))
.pipe(chmod(0o644))
+ .pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'))
.pipe(size({ showFiles: true, title: 'Full' }))
})
|