How to use the yargs.argv.debug function in yargs

To help you get started, we’ve selected a few yargs 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 liferay / alloy-editor / test / plugins / karma.js View on Github external
'use strict';

const alloyEditorDir = 'dist/alloy-editor/';

const argv = require('yargs').argv;
const path = require('path');

const coreSrcFiles = require('../core/_src.js');
const pluginsSrcFiles = require('./_src.js');

const preprocessors = {
    '**/*.html': ['html2js'],
    '+(test|src)/**/*.js': ['webpack']
};

if (!(argv.debug || argv.d)) {
    preprocessors[path.join(alloyEditorDir, 'test/**/*.js')] = ['coverage'];
}

const filesToLoad = [
    'test/vendor/zepto.js',
    'test/vendor/happen.js',

    /* CKEditor JS files */
    {
        pattern: path.join(alloyEditorDir, 'ckeditor.js'),
        included: true,
        watched: false
    }, {
        pattern: path.join(alloyEditorDir, 'styles.js'),
        included: true,
        watched: false
github fephil / garrus / tasks / scss.js View on Github external
gulp.task('scss', () => {
  return gulp.src(paths.scss + '**/*.scss')
  .pipe(gulpif(argv.debug === true, debug({title: 'CSS Processed:'})))
  .pipe(gulpif(!argv.production, sourcemaps.init())) // Sourcemaps if there is no production flag
  .pipe(sass().on('error', sass.logError))
  .pipe(postcss(output))
  .pipe(gulpif(!argv.production, sourcemaps.write('.'))) // Sourcemaps if there is no production flag
  .pipe(gulp.dest(paths.buildAssets + 'css'))
  .pipe(browserSync.stream({match: '**/*.css'}))
})
github okoala / vue-vuex / config / index.js View on Github external
const config = new Map()
const env = process.env.NODE_ENV

const envConfig = require('./' + env + '.json')


// ------------------------------------
// Environment
// ------------------------------------
config.set('env', env);
config.set('globals', {
  'NODE_ENV'     : config.get('env'),
  '__DEV__'      : config.get('env') === 'development',
  '__PROD__'     : config.get('env') === 'production',
  '__DEBUG__'    : !!argv.debug,
  '__DEBUG_NW__' : !!argv.nw
});

// ------------------------------------
// Server
// ------------------------------------
config.set('server_host', 'localhost');
config.set('server_port', process.env.PORT || envConfig.port || 4006);
config.set('api_target', envConfig.api_target)
config.set('view_cache', envConfig.view_cache)

// ------------------------------------
// Webpack
// ------------------------------------
config.set('webpack_port', 3004);
config.set('webpack_public_path',
github i18next / i18next-sprintf-postProcessor / gulpfile.js View on Github external
function rebundle() {
    bundler.bundle()
      .on('error', function(err) { console.error(err); this.emit('end'); })
      .pipe(source(output))
      .pipe(buffer())
      .pipe(gulpif(!argv.debug, uglify()))
      .pipe(gulpif(argv.debug, sourcemaps.init({ loadMaps: true })))
      .pipe(gulpif(argv.debug, sourcemaps.write('./')))
      .pipe(gulp.dest('./bin'));
  }
github i18next / i18next-localStorage-cache / gulpfile.js View on Github external
function rebundle() {
    bundler.bundle()
      .on('error', function(err) { console.error(err); this.emit('end'); })
      .pipe(source(output))
      .pipe(buffer())
      .pipe(gulpif(!argv.debug, uglify()))
      .pipe(gulpif(argv.debug, sourcemaps.init({ loadMaps: true })))
      .pipe(gulpif(argv.debug, sourcemaps.write('./')))
      .pipe(gulp.dest('./bin'));
  }
github i18next / i18next-xhr-backend / gulpfile.js View on Github external
function compile(watch) {
  var bundler = browserify('./src/' + entry, { debug: argv.debug, standalone: standaloneName }).transform(babelify);
  if (watch) {
    bundle = watchify(bundler);
  }

  function rebundle() {
    return bundler.bundle()
      .on('error', function(err) { console.error(err); this.emit('end'); })
      .pipe(source(output))
      .pipe(buffer())
      .pipe(gulpif(!argv.debug, uglify()))
      .pipe(gulpif(argv.debug, sourcemaps.init({ loadMaps: true })))
      .pipe(gulpif(argv.debug, sourcemaps.write('./')))
      .pipe(gulp.dest('./bin'));
  }

  if (watch) {
github i18next / react-i18next / gulpfile.js View on Github external
function rebundle() {
    return bundler.bundle()
      .on('error', function(err) { console.error(err); this.emit('end'); })
      .pipe(source(output))
      .pipe(buffer())
      .pipe(gulpif(!argv.debug, uglify()))
      .pipe(gulpif(argv.debug, sourcemaps.init({ loadMaps: true })))
      .pipe(gulpif(argv.debug, sourcemaps.write('./')))
      .pipe(gulp.dest('./bin'));
  }
github robertmain / pillars / gulp / common.js View on Github external
var config = {
	//Paths
	src: src,
	dist: dist,
	concatSrcCSSFile: gulpConfig.filenameSettings.concatSrcCSSFile,
	concatVendorCSSFile: gulpConfig.filenameSettings.concatVendorCSSFile,
	concatSrcJsFile: gulpConfig.filenameSettings.concatSrcJsFile,
	concatVendorJsFile: gulpConfig.filenameSettings.concatVendorJsFile,
	prefixBrowsers: gulpConfig.browserSettings.supportedBrowsers,

	bowerComponents: bower.config.directory,

	//Misc
	production: Boolean(argv.production),
	debug: Boolean(argv.debug),
	onError: function(error) {
		var pe = new PrettyError();
		pe.skipNodeFiles();
		console.log(pe.render(error));
	},
	srcUglifyConfig: {
		mangle: true,
		preserveComments: "none",
		output: {
			beautify: false
		}
	},
	vendorUglifyConfig: {
		mangle: true,
		preserveComments: "some",
		output: {
github StreetSupport / streetsupport-web / tasks / copy.js View on Github external
gulp.task('copyfonts', () => {
  return gulp.src(config.paths.fonts + '**/*', {})
  .pipe(gulpif(argv.debug === true, debug({title: 'Fonts Copied:'})))
  .pipe(gulp.dest(config.paths.buildAssets + 'fonts'))
})
github fephil / garrus / tasks / copy.js View on Github external
gulp.task('copyfonts', () => {
  return gulp.src(paths.fonts + '**/*', {})
  .pipe(gulpif(argv.debug === true, debug({title: 'Fonts Copied:'})))
  .pipe(gulp.dest(paths.buildAssets + 'fonts'))
})