【发布时间】:2016-07-14 09:50:26
【问题描述】:
我正在使用一些 gulp 任务来部署到生产环境,但是 gulp-deploy 有问题,我需要将其他文件夹中的其他文件复制到服务器上的不同位置,这是我的任务
//Gulp APP ftp deploy
gulp.task('deploy-app', function () {
var conn = ftp.create({
host: 'xxx',
user: 'xxx',
password: 'xxx',
parallel: 10,
log: gutil.log
});
var globs = [
'./css/**/*{css,png,jpg,gif,ttf,woff,eof,svg,woff2}',
'./img/**',
'./views/**',
'./scripts/**',
'index.html',
'Web.config'
];
// using base = '.' will transfer everything to /public_html correctly
// turn off buffering in gulp.src for best performance
return gulp.src(globs, { base: '.', buffer: false })
.pipe(conn.newer('/site/wwwroot')) // only upload newer files
.pipe(conn.dest('/site/wwwroot'));
});
我在这里遇到的问题是我不需要根目录中的 index.html,因为我在文件夹 dist 中还有另一个 index.html strong> 但它必须在服务器文件夹的根目录下,如何做到这一点
【问题讨论】:
标签: javascript gulp gulp-ftp vinyl-ftp