gulp


Get Gulp pipes of dependencies


I have a gulpfile with some tasks. All task are combined in a default task, that has dependencies to all others tasks. I want to add a deploy task. The deploy can take a list of files. I want only deploy changed files.
Is there a way to get the pipes of all dependencies? Or any other way, without merge everything into one task?
Here a simple sample to explain:
var gulp = require('gulp');
var concat = require('gulp-concat');
var debug = require('gulp-debug');
var newer = require('gulp-newer');
gulp.task('default', ['js', 'css']);
gulp.task('js', function () {
return gulp.src('./app/**/*.js')
.pipe(newer('./dist/app.js'))
.pipe(concat('app.js'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('css', function () {
gulp.src('./app/**/*.css')
.pipe(newer('./dist/style.css'))
.pipe(concat('style.css'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('deploy', ['default'], function () {
gulp.src('./dist/*')
// Here I want only files changed in dist
.pipe(debug());
});
Update:
Here some more of my task:
gulp.task('default', ['js', 'css', 'images', 'templates']);
gulp.task('images', function () {
return gulp.src('./app/images/*')
.pipe(newer('./dist/app/images'))
.pipe(gulp.dest('./dist/app/images'));
gulp.task('templates', function () {
return gulp.src('./app/**/*.html')
.pipe(newer('./dist/app/templates.js'))
.pipe(minifyHTML({ empty: true }))
.pipe(templateCache({ module: 'app' }))
.pipe(uglify())
.pipe(gulp.dest('./dist/app'));
I added a deployed folder, where i keep track of all files that a deployed.
var gulp = require('gulp');
var concat = require('gulp-concat');
var debug = require('gulp-debug');
var newer = require('gulp-newer');
gulp.task('default', ['js', 'css']);
gulp.task('js', function () {
return gulp.src('./app/**/*.js')
.pipe(newer('./dist/app.js'))
.pipe(concat('app.js'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('css', function () {
gulp.src('./app/**/*.css')
.pipe(newer('./dist/style.css'))
.pipe(concat('style.css'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('deploy', ['default'], function () {
gulp.src('./dist/*')
.pipe(newer('./deployed'))
.pipe(debug())
.pipe(gulp.dest('./deployed'))
});

Related Links

Minimist not finding arguments
Gulp.js. Same task on watch, with different parallel tasks
Split css for different devices
Gulpfile not working when module.exports references a Gulp task not a function?
Use gulp to process bowser files
Getting an error when trying to serve the app using browser-sync
Can't Sprite using gulp.spritesmith
How can I make build variables available to all JS files in gulp?
Gulp not installed globally?
gulp-useref deep folders error
use gulp+browserify+reactify, can't emit exit when got a ReactifyError
gulp-browserstack and gulp-cucumber don't seem to play nicely together
Gulp - Babel - EcmaScript-6 - Redux / Unhandled stream error in pipe
Delete all files using gulp except once that match pattern
Gulp task 'inject:vendor' does not inject Bower dependencies
Why do you open a gulp src pipe when you use gulp-watch?

Categories

HOME
macros
salesforce
cors
windows-server-2008
gap-system
c++builder
stdout
terminal
powerquery
docker-compose
opacity
restheart
subprocess
ejb-3.0
coding-style
velocity
osclass
watson-dialog
element
appsettings
owncloud
samba
geography
indri
novacode-docx
rndis
rvm
ppp
pypy
jboss-arquillian
boost-log
jmsserializerbundle
sampling
mapquest
wicket-tester
quartz
apiman
nshttpurlresponse
inner-join
geminabox
confluent
django-tables2
enet
node-java
aws-rds
sharpssh
totalview
blitz3d
firebase-job-dispatcher
toggleclass
networkstream
avi
phpdesigner
factorization
abstract
wizard
self-join
consul-template
playn
firewire
cakephp-2.6
targetprocess
httpmodule
radgrid
genero
veeam
optimistic-locking
static-files
dojox.grid
kss
report-builder2.0
novell
react-os
azure-caching
pidgin
iwork
ekevent
code-complete
grunt-contrib-imagemin
mencoder
angularjs-select2
panelgrid
pudb
xcode4.6.3
shapado
ios6-maps
beep
socketasynceventargs
gmagick
noise-reduction
rollover
chromebug
database-agnostic
code-golf
newspeak
httpbrowsercapabilities
cross-cutting-concerns

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App