How does vscode delete existing code on the server before uploading code using gulp?

because you don"t want to manually go to xftp and pull the packaged code into the project directory after each package, gulp and gulp-sftp are used to upload the code as follows:

  var gulp = require("gulp")
  var sftp = require("gulp-sftp")
  gulp.tast("default", function () {
    return gulp.src("/dist/**/*")
      .prpe(sftp({
        host: "xxxxx",
        port: 22,
        user: "xxxxx",
        pass: "xxxxx",
        remotePath: "xxxxx"
      }))
  })

upload is no problem, but will not delete the existing code package, I would like to ask, how to delete the existing code? I probably understand that it is operated through the command of ftp, but I don"t have any clue about it. Please advise ~


took a look at the source code. Other operations are not supported, only upload function. You can use gulp-cmd to operate the server through the ssh command, for example:

ssh root@host rm 
Menu