Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
forked fromgulpjs/gulp

The streaming build system

License

NotificationsYou must be signed in to change notification settings

jeremyross/gulp

 
 

Repository files navigation

gulp

The streaming build system

NPM versionDownloadsSupport usBuild StatusCoveralls StatusGitter chat

What is gulp?

gulp is a toolkit that will help you automate painful or time-consuming tasks in your development workflow. For web development (if that's your thing) it can help you by doing CSS preprocessing, JS transpiling, minification, live reloading, and much more.Integrations are built into all major IDEs and people are loving gulp across PHP, .NET, Node.js, Java, and more. With over 1700 plugins (and plenty you can do without plugins), gulp lets you quit messing with build systems and get back to work.

Documentation

For a Getting started guide, API docs, recipes, making a plugin, etc. see thedocumentation page!

Samplegulpfile.js

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

vargulp=require('gulp');varcoffee=require('gulp-coffee');varconcat=require('gulp-concat');varuglify=require('gulp-uglify');varimagemin=require('gulp-imagemin');varsourcemaps=require('gulp-sourcemaps');vardel=require('del');varpaths={scripts:['client/js/**/*.coffee','!client/external/**/*.coffee'],images:'client/img/**/*'};// Not all tasks need to use streams// A gulpfile is just another node program and you can use any package available on npmgulp.task('clean',function(cb){// You can use multiple globbing patterns as you would with `gulp.src`del(['build'],cb);});gulp.task('scripts',['clean'],function(){// Minify and copy all JavaScript (except vendor scripts)// with sourcemaps all the way downreturngulp.src(paths.scripts).pipe(sourcemaps.init()).pipe(coffee()).pipe(uglify()).pipe(concat('all.min.js')).pipe(sourcemaps.write()).pipe(gulp.dest('build/js'));});// Copy all static imagesgulp.task('images',['clean'],function(){returngulp.src(paths.images)// Pass in options to the task.pipe(imagemin({optimizationLevel:5})).pipe(gulp.dest('build/img'));});// Rerun the task when a file changesgulp.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']);

Incremental Builds

We recommend these plugins:

  • gulp-changed - only pass through changed files
  • gulp-cached - in-memory file cache, not for operation on sets of files
  • gulp-remember - pairs nicely with gulp-cached
  • gulp-newer - pass through newer source files only, supports many:1 source:dest

Want to contribute?

Anyone can help make this project better - check out theContributing guide!

Like what we do?

Support us via Gratipay

Bitdeli Badge

About

The streaming build system

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript95.3%
  • Shell4.7%

[8]ページ先頭

©2009-2025 Movatter.jp