How to use the gulp._ function in gulp

To help you get started, we’ve selected a few gulp 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 quasarframework / quasar-cli / lib / gulp / tasks / html.js View on Github external
function compile(production) {
  return gulp.src(gulp._.config.html.src, {base: gulp._.config.base})
    .pipe(gulp._.plugins.pipes.html.compile({
      prod: production
    }))
    .pipe(gulp._.plugins.if(production, gulp._.plugins.replace('app-dependencies.', 'app-dependencies.min.')))
    .pipe(gulp.dest(gulp._.config.html.dest));
}
github quasarframework / quasar-cli / lib / gulp / tasks / deps.js View on Github external
function compile(type, production) {
  var userSpecific = gulp._.config.app.deps[type] || [];
  var src = mapDependencies(
    gulp._.config.deps[type].src.concat(userSpecific),
    production,
    '.' + type,
    production
  );

  var pipe = gulp.src(src)
    .pipe(gulp._.plugins.newer(gulp._.config.deps[type].dest + '/' + gulp._.config.deps.name + '.' + type))
    .pipe(gulp._.plugins.pipes[type].deps({
      prod: production,
      name: gulp._.config.deps.name
    }))
    .pipe(gulp.dest(gulp._.config.deps[type].dest));

  if (type === 'css') {
github quasarframework / quasar-cli / lib / gulp / tasks / css.js View on Github external
function compile(production) {
  return gulp.src(gulp._.config.css.src, {base: gulp._.config.base})
    .pipe(gulp._.plugins.pipes.css.compile({
      prod: production
    }))
    .pipe(gulp.dest(gulp._.config.css.dest))
    .pipe(gulp._.config.browser.stream());
}
github quasarframework / quasar-cli / lib / gulp / tasks / js.js View on Github external
gulp.task('js:copy', function() {
  return gulp.src(gulp._.config.js.src, {base: gulp._.config.base})
    .pipe(gulp.dest(gulp._.config.js.tmp.dest));
});
github quasarframework / quasar-cli / lib / gulp / tasks / layouts.js View on Github external
function compile(production) {
  return gulp.src(gulp._.config.layouts.src)
    .pipe(gulp._.plugins.pipes.js.compile({
      prod: production,
      pack: gulp._.config.webpack
    }))
    .pipe(gulp.dest(gulp._.config.layouts.dest));
}
github quasarframework / quasar-cli / lib / gulp / tasks / dist.js View on Github external
gulp.task('dist:finalize', function() {
  gulp.src(gulp._.config.dist.src)
    .pipe(gulp.dest(gulp._.config.dist.dest));
});
github quasarframework / quasar-cli / lib / gulp / manifest.js View on Github external
'use strict';

var
  gulp = require('gulp'),
  fs = require('fs'),
  yaml = require('js-yaml'),
  path = require('path'),
  glob = require('glob')
  ;

var
  pageLen = (gulp._.config.base + '/pages/').length,
  layoutLen = (gulp._.config.base + '/layouts/').length
  ;

function getName(manifestPath, len) {
  return path.dirname(manifestPath).substring(len);
}

function getManifest(prefix, len, globFiles) {
  var
    manifests = glob.sync(globFiles),
    pages = {},
    config, pageName, cssFile
    ;

  manifests.forEach(function(manifestPath) {
    config = yaml.load(fs.readFileSync(manifestPath)) || {};
github quasarframework / quasar-cli / lib / gulp / manifest.js View on Github external
module.exports = function() {
  return JSON.stringify({
    pages: getManifest('style', pageLen, gulp._.config.appManifest.watch.pages),
    layouts: getManifest('layout', layoutLen, gulp._.config.appManifest.watch.layouts)
  });
};
github quasarframework / quasar-cli / lib / gulp / tasks / js.js View on Github external
function processJS(done, production) {
  gulp._.sequence(
    ['js:lint', 'js:copy'],
    'js:manifest',
    'js:compile:' + (production ? 'prod' : 'dev'),
    'js:clean',
    done
  );
}
github quasarframework / quasar-cli / lib / gulp / tasks / assets.js View on Github external
function compile(production) {
  var pipe = gulp.src(gulp._.config.assets.src, {base: gulp._.config.base})
    .pipe(gulp._.plugins.changed(gulp._.config.assets.dest));

  if (production) {
    pipe.pipe(gulp._.plugins.pipes.image.optimize());
  }

  return pipe.pipe(gulp.dest(gulp._.config.assets.dest));
}