Use SFTP profiles for different environments
developYou can define multiple environments (like dev and prod) within a single sftp.json file using the profiles key. This allows you to switch between different remote hosts and paths easily.
Important: The context and watcher keys are only available at the root level of the configuration and do not apply to individual profiles.
To switch between profiles, use the command SFTP: Set Profile from the Command Palette.
{
"username": "username",
"password": "password",
"remotePath": "/remote/workspace/a",
"watcher": {
"files": "dist/*.{js,css}",
"autoUpload": false,
"autoDelete": false
},
"profiles": {
"dev": {
"host": "dev-host",
"remotePath": "/dev",
"uploadOnSave": true
},
"prod": {
"host": "prod-host",
"remotePath": "/prod"
}
},
"defaultProfile": "dev"
}