Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
var gulp = require('gulp');
var browserify = require('browserify');
var uglify = require('gulp-uglify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var rename = require('gulp-rename');
var gulpif = require('gulp-if');
var sass = require('gulp-sass');
var pug = require('gulp-pug');
var copy = require('gulp-copy');
var eslint = require('gulp-eslint');
var sourcemaps = require('gulp-sourcemaps');
var header = require('gulp-header');
var isSourcemaps = require('minimist')(process.argv.slice(2)).sourcemaps;
var appVersion = require('./package.json').version;
// LIB
gulp.task('lint', function() {
return gulp.src('./lib/*.js').pipe(eslint())
.pipe(eslint.format())
// Brick on failure to be super strict
.pipe(eslint.failOnError());
});
gulp.task('build', gulp.series('lint',function() {
return browserify({ entries: 'standalone.js', debug: isSourcemaps }).bundle()
.pipe(source('./granim.js'))
.pipe(buffer())
.pipe(gulpif(!isSourcemaps, header('/*! Granim v' + appVersion + ' - https://sarcadass.github.io/granim.js */\n')))