How to enable compile on save on Visual Studio with sfdx-vscode plugin?

You can't compile your code automatically like you did before with the first version of the Eclipse plugin. The new plugin makes use of the Language Server Protocole which will help you find errors locally, but you'll still have to use sfdx force:source:push to compile everything.

If you have access to the Trailblazer Community, there is a thread about this here.

Additionally, you can automatically push your changes to your Scratch Org using Nodemon, as described in this blog post.


If you're looking for auto deploy, you can set this in the workspace settings... To push files each time you save them, set the user or workspace setting

 salesforcedx-vscode-core.push-or-deploy-on-save.enabled:true

Reference to Article

https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/package-development-model


This feature has been added in a Feature Preview option to the Salesforce VS-Code extension. Click here for details.