当gulp正在ftp服务器上部署src时,我正在试图找出如何在不使用dist dir的情况下发送文件。
我的配置:
var gutil = require( 'gulp-util' );
var ftp = require( 'vinyl-ftp' );
gulp.task( 'deploy', function() {
var conn = ftp.create( {
host: 'hydrogen',
user: 'hosting',
password: 'test',
parallel: 10,
log: gutil.log
} );
var globs = [
'src/**',
'css/**',
'js/**',
'fonts/**',
'index.html'
];
// 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( '/projects/test' ) ) // only upload newer files
.pipe( conn.dest( '/projects/test' ) );
} );所以,在部署之后,我得到了projects/test/src路径。我想获得没有src dir的文件,或者重命名它。
发布于 2015-08-11 16:27:45
尝试使用压扁从文件中删除路径信息。
https://stackoverflow.com/questions/31946989
复制相似问题