gulp src and destination is not injecting into my index.html file

281 views Asked by At

So when I have a project that has the gulpfile in the same folder as my index.html

but Now that I have a project in which I want the gulpfile.js inside a folder and the root of my project has the index.html ( yes with all the correct tags)

Same folder this works

return gulp.src('*.html')
.pipe(wiredep(options))
.pipe(inject(injectSrc, injectOptions))
.pipe(gulp.dest(''));

index.html is now back outside the gulp file directory

return gulp.src('*.html')
.pipe(wiredep(options))
.pipe(inject(injectSrc, injectOptions))
.pipe(gulp.dest('../index.html'));

I gather that I don't understand the src and dest of gulp , what am i needing to do?

1

There are 1 answers

1
LIXer On

i think your param for gulp.dest will be a 'folder', not a 'file' path. like: '../'

and if you want to rename your html file to index.html, you should use gulp-rename to do it before your gulp.dest