How to use the minimist.sourcemaps function in minimist

To help you get started, we’ve selected a few minimist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sarcadass / granim.js / gulpfile.js View on Github external
'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())
		// Brick on failure to be super strict

gulp.task('build', gulp.series('lint',function() {
	return browserify({ entries: 'standalone.js', debug: isSourcemaps }).bundle()
		.pipe(gulpif(!isSourcemaps, header('/*! Granim v' + appVersion + ' - */\n')))