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
-
Open the angular app in your favorite code editor.
-
Navigate to the
angular.json
file. -
Now, add a new folder path to the
outputPath
property.
{
"$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