Npm gulp src和destination未注入到我的index.html文件中

Npm gulp src和destination未注入到我的index.html文件中,npm,gulp,bower,gulp-inject,wiredep,Npm,Gulp,Bower,Gulp Inject,Wiredep,因此,当我有一个项目,其中gulpfile与index.html位于同一文件夹中时 但是现在我有了一个项目,我希望gulpfile.js在一个文件夹中,并且我的项目的根目录有index.html(是的,有所有正确的标记) 与此工作的文件夹相同 return gulp.src('*.html') .pipe(wiredep(options)) .pipe(inject(injectSrc, injectOptions)) .pipe(gulp.dest('')); index.html现在回到g

因此,当我有一个项目,其中gulpfile与index.html位于同一文件夹中时

但是现在我有了一个项目,我希望gulpfile.js在一个文件夹中,并且我的项目的根目录有index.html(是的,有所有正确的标记)

与此工作的文件夹相同

return gulp.src('*.html')
.pipe(wiredep(options))
.pipe(inject(injectSrc, injectOptions))
.pipe(gulp.dest(''));
index.html现在回到gulp文件目录之外

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

我想我不明白gulp的
src
dest
,我需要做什么?

我想你的
gulp.dest
参数将是一个“文件夹”,而不是一个“文件”路径。比如:“../”


如果你想将你的html文件重命名为index.html,你应该使用
gulp rename
在你的
gulp.dest

我在根目录中有一个index.html,它只需要被注入,所以我甚至不知道gulp.src的目的是什么,对我来说,我不想复制任何东西,只是注入东西,所以gulp.dest是一个一级的index.html,而gulp没有注入它