Reputation: 16801
I created a project for becoming familiar with build tools. My folder structure for this project looks like so:
+ my-project
|-- + sources
|------ index.html
|-- + www
|-- gulpfile.js
And the contents of glupfile.js
are:
var gulp = require('gulp');
gulp.task('default', function() {
gulp.src('sources/index.html')
.pipe(gulp.dest('www/index.html'));
});
For simplicity's sake I chmod
'd everything in this folder (and all parent folders) to 777
- so there's no issue of file permissions.
Yet when I run gulp
, I get the following output:
user@server:~/my-project# gulp
[00:05:09] Using gulpfile ~/my-project/gulpfile.js
[00:05:09] Starting 'default'...
[00:05:09] Finished 'default' after 11 ms
and absolutely no files are created. The www
folder remains barren.
What am I doing wrong?
Upvotes: 2
Views: 7132
Reputation: 1031
Leave out the index.html. You should always pipe your files into a folder(desc) and not to another file(index.html)
var gulp = require('gulp');
gulp.task('default', function() {
gulp.src('sources/index.html')
.pipe(gulp.dest('www'));
});
Upvotes: 4