2019-03-22 13:48:42 +01:00
|
|
|
const {src, dest, parallel} = require('gulp');
|
|
|
|
const uglify = require('gulp-uglify');
|
|
|
|
const rename = require('gulp-rename');
|
2019-03-22 14:26:44 +01:00
|
|
|
const concat = require('gulp-concat');
|
2019-04-16 12:16:29 +02:00
|
|
|
const replace = require('gulp-replace');
|
2019-03-22 13:48:42 +01:00
|
|
|
|
2019-03-22 14:26:44 +01:00
|
|
|
function vendors() {
|
2019-03-22 13:48:42 +01:00
|
|
|
return src([
|
2019-03-22 15:14:11 +01:00
|
|
|
'./node_modules/optimal-select/dist/optimal-select.js',
|
|
|
|
'./node_modules/hammerjs/hammer.js',
|
|
|
|
'./node_modules/propagating-hammerjs/propagating.js',
|
|
|
|
'./node_modules/pixi.js/dist/pixi.js',
|
|
|
|
'./node_modules/pixi-compressed-textures/lib/crn_decomp.js',
|
|
|
|
'./node_modules/pixi-compressed-textures/bin/pixi-compressed-textures.js',
|
|
|
|
'./node_modules/pixi-filters/dist/pixi-filters.js',
|
|
|
|
'./node_modules/pixi-particles/dist/pixi-particles.js',
|
|
|
|
'./node_modules/pixi-projection/dist/pixi-projection.js',
|
2019-05-27 11:01:48 +02:00
|
|
|
'./node_modules/gsap/src/uncompressed/TweenMax.js',
|
|
|
|
'./node_modules/gsap/src/uncompressed/TimelineMax.js',
|
2019-05-14 13:56:05 +02:00
|
|
|
'./lib/3rdparty/pixi-ease.js',
|
|
|
|
'./lib/3rdparty/pixi-viewport.js',
|
|
|
|
'./lib/3rdparty/convertPointFromPageToNode.js'
|
2019-03-22 13:48:42 +01:00
|
|
|
], {sourcemaps: false})
|
2019-03-22 14:26:44 +01:00
|
|
|
.pipe(concat('iwmlib.3rdparty.js'))
|
2019-04-16 12:16:29 +02:00
|
|
|
.pipe(replace(/^\/\/# sourceMappingURL=.*$/gmi, ''))
|
2019-03-22 14:26:44 +01:00
|
|
|
.pipe(dest('dist', {sourcemaps: false}))
|
2019-03-22 13:48:42 +01:00
|
|
|
.pipe(rename({extname: '.min.js'}))
|
|
|
|
.pipe(uglify())
|
2019-03-22 14:26:44 +01:00
|
|
|
.pipe(dest('dist', {sourcemaps: false}))
|
2019-03-22 13:48:42 +01:00
|
|
|
}
|
|
|
|
|
2019-03-22 14:26:44 +01:00
|
|
|
function preload() {
|
|
|
|
return src([
|
2019-05-27 11:01:48 +02:00
|
|
|
'./node_modules/gsap/src/uncompressed/TweenMax.js',
|
2019-03-22 14:26:44 +01:00
|
|
|
'./lib/3rdparty/convertPointFromPageToNode.js',
|
|
|
|
], {sourcemaps: false})
|
|
|
|
.pipe(concat('iwmlib.3rdparty.preload.js'))
|
2019-04-16 12:16:29 +02:00
|
|
|
.pipe(replace(/^\/\/# sourceMappingURL=.*$/gmi, ''))
|
2019-03-22 14:26:44 +01:00
|
|
|
.pipe(dest('dist', {sourcemaps: false}))
|
|
|
|
.pipe(rename({extname: '.min.js'}))
|
|
|
|
.pipe(uglify())
|
|
|
|
.pipe(dest('dist', {sourcemaps: false}))
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.default = parallel(vendors, preload);
|