Skip to content

The streaming build system (v3 with long-term support)

License

Notifications You must be signed in to change notification settings

electric-eloquence/gulp

 
 

Repository files navigation

gulp 3 lts

The streaming build system

Known Vulnerabilities Linux Build Status Mac Build Status Windows Build Status Coverage Status License

This package provides long-term support for gulp at major version 3.

This includes maintenance fixes and security updates.

Install

  • Latest version (without Git):
    • npm install https://github.com/electric-eloquence/gulp/tarball/v3-lts@3.9.17
    • Or add "gulp": "https://github.com/electric-eloquence/gulp/tarball/v3-lts@3.9.17" as a dependency in package.json.
  • Latest version (with Git):
    • npm install electric-eloquence/gulp
  • Specific version (with Git):
    • npm install electric-eloquence/gulp#3.9.17
  • Semver range (with Git):
    • npm install electric-eloquence/gulp#semver:^3.9.17
  • When installed one of these ways, other packages depending on gulp will get gulp 3 with long-term support.

What is gulp?

  • Automation - gulp is a toolkit that helps you automate painful or time-consuming tasks in your development workflow.
  • Platform-agnostic - Integrations are built into all major IDEs and people are using gulp with PHP, .NET, Node.js, Java, and other platforms.
  • Strong Ecosystem - Use npm modules to do anything you want + over 2000 curated plugins for streaming file transformations.
  • Simple - By providing only a minimal API surface, gulp is easy to learn and simple to use.

Documentation

For a Getting Started guide, API docs, recipes, making a plugin, etc. check out our docs!

Sample gulpfile.js

This file will give you a taste of what gulp does.

var gulp = require('gulp');
var coffee = require('gulp-coffee');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var sourcemaps = require('gulp-sourcemaps');
var del = require('del');

var paths = {
  scripts: ['client/js/**/*.coffee', '!client/external/**/*.coffee'],
  images: 'client/img/**/*'
};

gulp.task('clean', function() {
  // Not all tasks need to use streams.
  // A gulpfile is just another node program and you can use any package
  // available on npm.
  return del(['build']);
});

gulp.task('scripts', ['clean'], function() {
  // Minify and copy all JavaScript (except vendor scripts) with
  // sourcemaps all the way down.
  return gulp.src(paths.scripts)
    .pipe(sourcemaps.init())
      .pipe(coffee())
      .pipe(uglify())
      .pipe(concat('all.min.js'))
    .pipe(sourcemaps.write())
    .pipe(gulp.dest('build/js'));
});

gulp.task('imagemin', function() {
  // Minify and copy all static images.
  return gulp.src(paths.images)
    // Pass in options to the task
    .pipe(imagemin({ optimizationLevel: 5 }))
    .pipe(gulp.dest('build/img'));
});

gulp.task('images', function(cb) {
  // The run-sequence package and method are now internal to gulp
  // and will receive long-term support for the life of gulp 3 lts.
  // https://github.com/OverZealous/run-sequence
  gulp.runSeq( // or gulp.runSequence
    'clean',
    'imagemin',
    cb
  );
});

// Rerun the task when a file changes.
gulp.task('watch', function() {
  gulp.watch(paths.scripts, ['scripts']);
  gulp.watch(paths.images, ['images']);
});

// The default task (called when you run `gulp` from cli).
gulp.task('default', ['watch', 'scripts', 'images']);

Troubleshooting Installation

  • npm ERR! code EINTEGRITY
    • If npm warns that the tarball seems to be corrupted, delete your package-lock.json, and install again.

Acknowledgments

This package is forked from the upstream source with the same name. This fork is mostly derivative and adds little functionality. Credit and gratitude are due for the contributors to the source. It is our intent to work in their favor by maintaining an older version of their project, which may otherwise be burdensome for them to commit time to.

About

The streaming build system (v3 with long-term support)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.1%
  • Shell 0.9%