VSCode-sftp插件

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

项目送测之前用的是gitlab-ci,在服务器上先build,然后run,结果build过程vue项目太慢、太费内存,所以想直接在本地build完后打包上传到服务器,于是找了个VSCode上的插件在同步文件.

1.安装sftp插件

直接扩展里搜索sftp即可。

2.配置

Ctrl+Shift+P打开命令行,输入SFTP:config,会在.vscode目录里新建文件sftp.json,输入以下配置信息

{
    "host": "xxxx",
    "protocol": "sftp",
    "port": 22,
    "username": "username",
    "password": "password",
    "remotePath": "/home/ysn/front/ops", //远程服务器目录
    "syncOption": {
      "delete": true
    },
    "watcher": {
      "files": "dist/", //监听本地文件夹更新或删除时自动上传
      "autoUpload": true,
      "autoDelete": true
    }
}

这样运行npm test后;本地dist目录发生改变后,会同步到远程服务器上的目录里。

sftp github

转载于:https://my.oschina.net/u/3656540/blog/3006427

你可能感兴趣的:(VSCode-sftp插件)