如何解决使用 gulp-ssh
我正在尝试运行 gulp-ssh (https://www.npmjs.com/package/gulp-ssh),但即使文件被编译,它们也不会发送到服务器。我无法弄清楚出了什么问题。你能想到什么吗?谢谢
const gulp = require('gulp');
const sass = require('gulp-sass');
const GulpSSH = require('gulp-ssh');
const config = {
host: "123.0.0.1",port: "22",user: "user",password: "pass"
};
const gulpSSH = new GulpSSH({
ignoreErrors: false,sshConfig: config
})
function css() {
return gulp
.src("source/sass/**/*.scss")
.pipe(sass().on('error',function (err) {
console.log(err.message);
this.emit('end');
}))
.pipe(gulpSSH.sftp('write','var/www/mysite/css'))
}
function watchFiles() {
gulp.watch("source/sass/**/*.scss",css);
}
const watch = gulp.parallel(watchFiles);
exports.css = css;
exports.watch = watch;
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。