by Sai gowtham

Changing the dist folder path in Angular

When you run an ng-build command angular bundles your app for production and placed it inside dist/your-app folder. In this tutorial, we are going to learn about how to change the dist folder path in angular.

Changing the dist folder

  1. Open the angular app in your favorite code editor.
  2. Navigate to the angular.json file.
  3. Now, add a new folder path to the outputPath property.
angular.json
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "my-p-angular": {
      "projectType": "application",
      "schematics": {},
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "msg-app",

Here I added msg-app as my output path, so when I run ng bundle command my production angular app is placed inside the msg-app folder.

or you can change it by adding a --outputPath=folder-name flag after the ng build command.

ng build --outputPath=msg-app

Top Udemy Courses

JavaScript - The Complete Guide 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
45,614 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
130,921 students enrolled
48.5 hours of video content
View Course