简体   繁体   English

Gulp任务将文件夹复制到构建文件夹中给出空文件夹

[英]Gulp task to copy folder into build folder give empty folder

So i have built my own module and am trying to make a gulp task to copy the folder into my build folder. 因此,我已经建立了自己的模块,并试图做一个吞吞吐吐的任务,将文件夹复制到我的构建文件夹中。 When this happens, nothing inside the folder is created in my build folder, it is just an empty folder. 发生这种情况时,在我的build文件夹中没有创建该文件夹内的任何内容,它只是一个空文件夹。

My gulp task: 我的任务:

gulp.task("MyModule", function() {
    return gulp.src("MyModule")
        .pipe(chmod(777))
        .pipe(gulp.dest(paths.build.node_modules));
});

paths.build.node_modules resolves to: build/node_modules MyModule is in the root of the application folder. path.build.node_modules解析为:build / node_modules MyModule在应用程序文件夹的根目录中。

Any reason why it would just be copying the folder and nothing inside of it? 出于什么原因,它只会复制文件夹而里面什么也没有?

You're not instructing it to copy the contents of the folder. 您不是在指示它复制文件夹的内容。

try gulp.src(["MyModule", "MyModule/**/*"], base:{'.'}) to copy the folder and everything in it instead of just the folder. 尝试gulp.src(["MyModule", "MyModule/**/*"], base:{'.'})复制文件夹及其中的所有内容,而不仅仅是文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM