const {src, dest, parallel} = require('gulp'); const uglify = require('gulp-uglify'); const rename = require('gulp-rename'); const concat = require('gulp-concat'); function vendors() { return src([ './lib/3rdparty/jquery.js', './lib/3rdparty/optimal-select.js', './lib/3rdparty/hammer.js', './lib/3rdparty/hammer.propagating.js', './lib/3rdparty/d3/d3.js', './lib/3rdparty/d3/d3-selection-multi.js', './lib/3rdparty/highlight/**/*.js', './lib/3rdparty/pixi/pixi.js', './lib/3rdparty/pixi/lib/crn_decomp.js', './lib/3rdparty/pixi/pixi-compressed-textures.js', './lib/3rdparty/pixi/pixi-filters.js', './lib/3rdparty/pixi/pixi-particles.js', './lib/3rdparty/pixi/pixi-projection.js', './lib/3rdparty/greensock/src/uncompressed/**/*.js', './lib/3rdparty/convertPointFromPageToNode.js', ], {sourcemaps: false}) .pipe(concat('iwmlib.3rdparty.js')) .pipe(dest('dist', {sourcemaps: false})) .pipe(rename({extname: '.min.js'})) .pipe(uglify()) .pipe(dest('dist', {sourcemaps: false})) } function preload() { return src([ './lib/3rdparty/highlight/**/*.js', './lib/3rdparty/greensock/src/uncompressed/plugins/*.js', './lib/3rdparty/greensock/src/uncompressed/TweenLite.js', './lib/3rdparty/convertPointFromPageToNode.js', ], {sourcemaps: false}) .pipe(concat('iwmlib.3rdparty.preload.js')) .pipe(dest('dist', {sourcemaps: false})) .pipe(rename({extname: '.min.js'})) .pipe(uglify()) .pipe(dest('dist', {sourcemaps: false})) } exports.default = parallel(vendors, preload);