Linted gulpfile.

This commit is contained in:
Sebastian Kupke 2019-07-16 15:10:15 +02:00
parent 3c8f0bac1b
commit 78108c4090

View File

@ -1,11 +1,12 @@
const {src, dest, parallel} = require('gulp'); const { src, dest, parallel } = require('gulp')
const uglify = require('gulp-uglify'); const uglify = require('gulp-uglify')
const rename = require('gulp-rename'); const rename = require('gulp-rename')
const concat = require('gulp-concat'); const concat = require('gulp-concat')
const replace = require('gulp-replace'); const replace = require('gulp-replace')
function vendors() { function vendors() {
return src([ return src(
[
'./node_modules/optimal-select/dist/optimal-select.js', './node_modules/optimal-select/dist/optimal-select.js',
'./node_modules/hammerjs/hammer.js', './node_modules/hammerjs/hammer.js',
'./node_modules/propagating-hammerjs/propagating.js', './node_modules/propagating-hammerjs/propagating.js',
@ -20,9 +21,11 @@ function vendors() {
'./lib/3rdparty/pixi-ease.js', './lib/3rdparty/pixi-ease.js',
'./lib/3rdparty/pixi-viewport.js', './lib/3rdparty/pixi-viewport.js',
'./lib/3rdparty/convertPointFromPageToNode.js' './lib/3rdparty/convertPointFromPageToNode.js'
], {sourcemaps: false}) ],
{ sourcemaps: false }
)
.pipe(concat('iwmlib.3rdparty.js')) .pipe(concat('iwmlib.3rdparty.js'))
.pipe(replace(/^\/\/# sourceMappingURL=.*$/gmi, '')) .pipe(replace(/^\/\/# sourceMappingURL=.*$/gim, ''))
.pipe(dest('dist', { sourcemaps: false })) .pipe(dest('dist', { sourcemaps: false }))
.pipe(rename({ extname: '.min.js' })) .pipe(rename({ extname: '.min.js' }))
.pipe(uglify()) .pipe(uglify())
@ -30,16 +33,19 @@ function vendors() {
} }
function preload() { function preload() {
return src([ return src(
[
'./node_modules/gsap/src/uncompressed/TweenMax.js', './node_modules/gsap/src/uncompressed/TweenMax.js',
'./lib/3rdparty/convertPointFromPageToNode.js', './lib/3rdparty/convertPointFromPageToNode.js'
], {sourcemaps: false}) ],
{ sourcemaps: false }
)
.pipe(concat('iwmlib.3rdparty.preload.js')) .pipe(concat('iwmlib.3rdparty.preload.js'))
.pipe(replace(/^\/\/# sourceMappingURL=.*$/gmi, '')) .pipe(replace(/^\/\/# sourceMappingURL=.*$/gim, ''))
.pipe(dest('dist', { sourcemaps: false })) .pipe(dest('dist', { sourcemaps: false }))
.pipe(rename({ extname: '.min.js' })) .pipe(rename({ extname: '.min.js' }))
.pipe(uglify()) .pipe(uglify())
.pipe(dest('dist', { sourcemaps: false })) .pipe(dest('dist', { sourcemaps: false }))
} }
exports.default = parallel(vendors, preload); exports.default = parallel(vendors, preload)