diff options
author | Sam Potts <sam@selz.com> | 2018-02-17 09:22:34 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-17 09:22:34 +1100 |
commit | c2a6306d469834df557f6fa0af58d8de7aa8de4e (patch) | |
tree | 3f6b9dbc32912a990d0bf1094c5bd33623eb8f59 /gulpfile.js | |
parent | c90f1bdf08c002b55e92222583f994433239fb37 (diff) | |
parent | 7ac732f45b961301f56877a61d7607b3232537f0 (diff) | |
download | plyr-c2a6306d469834df557f6fa0af58d8de7aa8de4e.tar.lz plyr-c2a6306d469834df557f6fa0af58d8de7aa8de4e.tar.xz plyr-c2a6306d469834df557f6fa0af58d8de7aa8de4e.zip |
Merge pull request #781 from friday/gulp-unminified-js-output
Build both minified and non-minified js-bundles
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gulpfile.js b/gulpfile.js index 8f9b1836..eb3076db 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,6 +9,7 @@ const path = require('path'); const gulp = require('gulp'); const gutil = require('gulp-util'); const concat = require('gulp-concat'); +const filter = require('gulp-filter'); const sass = require('gulp-sass'); const cleancss = require('gulp-clean-css'); const run = require('run-sequence'); @@ -24,8 +25,7 @@ const size = require('gulp-size'); const rollup = require('gulp-better-rollup'); const babel = require('rollup-plugin-babel'); const sourcemaps = require('gulp-sourcemaps'); -const uglify = require('rollup-plugin-uglify'); -const { minify } = require('uglify-es'); +const uglify = require('gulp-uglify'); const commonjs = require('rollup-plugin-commonjs'); const resolve = require('rollup-plugin-node-resolve'); @@ -122,6 +122,7 @@ const build = { Object.keys(files).forEach(key => { const name = `js:${key}`; tasks.js.push(name); + const {output} = paths[bundle]; gulp.task(name, () => gulp @@ -135,15 +136,20 @@ const build = { resolve(), commonjs(), babel(babelrc), - uglify({}, minify), ], }, options, ), ) + .pipe(sourcemaps.write('')) + .pipe(gulp.dest(output)) + .pipe(filter('**/*.js')) + .pipe(uglify()) .pipe(size(sizeOptions)) + .pipe(rename({suffix:'.min'})) .pipe(sourcemaps.write('')) - .pipe(gulp.dest(paths[bundle].output)), + .pipe(gulp.dest(output)), + ); }); }, |