Answer the question
In order to leave comments, you need to log in
What do gulp.src, gulp.dest, and gulp.watch expect as input?
1) I have a Gulpfile:
'use strict';
var gulp = require('gulp'),
less = require('gulp-less'),
livereload = require('gulp-livereload'),
http = require('http'),
st = require('st');
gulp.task('less', function() {
gulp.src('app/styles/*.less')
.pipe(less())
.pipe(gulp.dest('dist/styles'))
.pipe(livereload());
});
gulp.task('watch', ['server'], function() {
livereload.listen({ basePath: 'dist' });
gulp.watch('less/*.less', ['less']);
});
gulp.task('server', function(done) {
http.createServer(
st({ path: __dirname + '/dist', index: 'index.html', cache: false })
).listen(8080, done);
});
Answer the question
In order to leave comments, you need to log in
https://github.com/gulpjs/gulp/blob/master/docs/API.md
To understand you have to delve into nodejs itself, this is not a browser for you ;-)
var gulp = require('gulp');
gulp.task('default', function() {
gulp.src("./*.css")
.pipe(gulp.dest('./'));
gulp.watch('./*.js', function(event) {
console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question