Changing the dist folder path in Angular

Changing the dist folder path in Angular

In this post we will give you information about Changing the dist folder path in Angular. Hear we will give you detail about Changing the dist folder path in AngularAnd how to use it also give you demo for it if it is necessary.

When you run an ng-build command angular bundles your app for production and placed it inside dist/your-app folder. 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

Hope this code and post will helped you for implement Changing the dist folder path in Angular. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US