visual-studiovue.jsmicrosoft-web-deploy

Automatically deploy VueJS with Visual Studio


I found this question. Right now, my deployment works as follows:

  1. Hit the web depoly button in VS. In the old ASP.NET world, this was all that had to be done.
  2. Open the developer command prompt.
  3. Run npm run build
  4. Open the project folder and find the index.html file and the dist folder.
  5. Open another Explorer and navigate to the IIS's shared folder.
  6. Copy the files onto the server.

My question is, if there is a simple way to integrate steps 2 to 6 into the UI web deploy command of Visual Studio. I guess, that I am not the only person on the planet who is looking for such a one-click solution, but unfortunately I can't find anything. But I'm pretty sure, that I'm just searching for the wrong keywords.


Solution

  • The most simple solution would be to write a simple script that does steps 3-6, and then find a way to make VS Code run it. However, if you are making regular changes, you should probably commit your code to a repository like git and use CI/CD to make the deployment a part of your code commit. Even if you aren't branching your project - the purpose is to automate your build and deploy workflow. With Continuous Integration (CI), as soon as you commit your code, it will then be automatically deployed. In the long run, following this kind of workflow will save you time.

    Some projects that you could use for this kind of workflow: