How to use the gulp.lastRun 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 aurelia-contrib / aurelia-combo / aurelia_project / tasks / transpile.js View on Github external
function buildJavaScript() {
  let transpile = babel(project.transpiler.options);
  if (useCache) {
    // the cache directory is "gulp-cache/projName-env" inside folder require('os').tmpdir()
    // use command 'au clear-cache' to purge all caches
    transpile = cache(transpile, {name: project.name + '-' + env});
  }

  return gulp.src(project.transpiler.source, {sourcemaps: true, since: gulp.lastRun(buildJavaScript)})
    .pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')}))
    .pipe(transpile)
    .pipe(build.bundle());
}
github jr-cologne / gulp-starter-kit / gulpfile.js View on Github external
gulp.task('less', () => {
  return gulp.src([ src_assets_folder + 'less/**/!(_)*.less'], { since: gulp.lastRun('less') })
    .pipe(sourcemaps.init())
      .pipe(plumber())
      .pipe(less())
      .pipe(autoprefixer())
      .pipe(minifyCss())
    .pipe(sourcemaps.write('.'))
    .pipe(gulp.dest(dist_assets_folder + 'css'))
    .pipe(browserSync.stream());
});
github ladjs / lad / template / gulpfile.js View on Github external
async function compile() {
  return src('build/js/**/*.js', {
    since: lastRun(compile)
  })
    .pipe(sourcemaps.init({ loadMaps: true }))
    .pipe(envify(env))
    .pipe(unassert())
    .pipe(babel())
    .pipe(gulpif(PROD, terser()))
    .pipe(gulpif(PROD, rev()))
    .pipe(sourcemaps.write('./'))
    .pipe(dest(config.buildBase))
    .pipe(gulpif(DEV, lr(config.livereload)))
    .pipe(gulpif(PROD, rev.manifest(config.manifest, manifestOptions)))
    .pipe(gulpif(PROD, dest(config.buildBase)));
}
github airform / airform / packages / aurelia-airform / aurelia_project / tasks / copy-files.ts View on Github external
export default function copyFiles(done) {
  if (typeof project.build.copyFiles !== 'object') {
    done();
    return;
  }

  const instruction = getNormalizedInstruction();
  const files = Object.keys(instruction);

  return gulp.src(files, {since: gulp.lastRun(copyFiles)})
    .pipe(gulp.dest(x => {
      const filePath = prepareFilePath(x.path);
      const key = files.find(f => minimatch(filePath, f));
      return instruction[key];
    }));
}
github zkoss / zk / gulpfile.js View on Github external
function typescript_dev_zkmax() {
    return typescript_dev(
        '../zkcml/zkmax/src/archive',
        '../zkcml/zkmax/debug/classes',
        gulp.lastRun(typescript_dev_zkmax)
    );
}
github airform / airform / packages / aurelia-airform / aurelia_project / tasks / process-json.ts View on Github external
export default function processJson () {
  return gulp
    .src(project.jsonProcessor.source, { since: gulp.lastRun(processJson) })
    .pipe(build.bundle())
}
github microsoft / fluent-ui-react / build / gulp / tasks / docs.ts View on Github external
task('build:docs:toc', () =>
  src(markdownSrc, { since: lastRun('build:docs:toc') }).pipe(
    through2.obj((file, enc, done) => {
      sh(`doctoc ${file.path} --github --maxlevel 4 && git add ${file.path}`, done)
    }),
  ),
)
github antongunov / favicongrabber.com / gulp / tasks / fonts.js View on Github external
gulp.task('fonts', () => gulp.src(['assets/fonts/*', 'node_modules/font-awesome/fonts/*'], { since: gulp.lastRun('fonts') })
    .pipe(gulp.dest('build/assets/fonts/')));
github YangQiGitHub / wx-miniprogram-boilerplate / gulpfile.js View on Github external
const js = () => {
  return gulp
    .src(jsFiles, { since: gulp.lastRun(js) })
    .pipe(eslint())
    .pipe(eslint.format())
    .pipe(gulp.dest(distPath));
};
gulp.task(js);