How To Publish An Angular Application

Open Visual Studio Code and your project. If you haven't created a project already, then you can create a blank project using the following command in the terminal.

“ng new <projectname>”

After the project is successfully created, open that project folder in Visual Studio Code and you can follow the below steps.

  • Go to the terminal and type the command “ng build --prod” and wait for a few seconds or a minute.

    How To Publish An Angular Application
    Successful command execution
  • After successful execution of the command, a “dist” folder will be generated in the project directory. You can see it in the VS Code.

    How To Publish An Angular Application
  • Right-click on it and select “Reveal in Explorer” or you can go to “dist” directly by using the file explorer.

  • Now, go inside the dist folder where you will find a folder named as your project. Copy all the data from inside that folder and paste it on your hosting root directory. Let’s say if your hosting root directory is named “site1”, then paste the whole dist folder to it.

    How To Publish An Angular Application

  • Here, I have used FileZilla. I see zero failed transfers and all successful transfers. Now, my Angular application is successfully published. Let us check the newly published Angular application on our domain.

    How To Publish An Angular Application