Andy Man
Andy Man

Reputation: 11

Angular 8 Angular-cli generates build instead of dist directory with ng build

I have checked out a dozen questions on Stackoverflow, but it is still not working.

I have the latest @angular/cli installed globally and also in my project. When I run ng version, this is the output:

Angular CLI: 8.3.23
Node: 10.15.3
OS: win32 x64
Angular: 8.0.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.23
@angular-devkit/build-angular     0.803.23
@angular-devkit/build-optimizer   0.803.23
@angular-devkit/build-webpack     0.803.23
@angular-devkit/core              8.3.23
@angular-devkit/schematics        8.3.23
@angular/cli                      8.3.23
@angular/http                     7.2.16
@ngtools/webpack                  8.3.23
@schematics/angular               8.3.23
@schematics/update                0.803.23
rxjs                              6.5.4
typescript                        3.4.5
webpack                           4.39.2

I tried

npm uninstall @angular/cli -g;
npm cache clean --force;
npm install @angular/cli -g;
npm cache verify;
close / open console;
cd <project>;
npm install;
ng --version; (result: 8.2.23)

Afterwards, I use ng build --prod, it creates a build directory instead of the dist directory.

Part of folder structure:

.vscode 
arm-templates 
build 
e2e 
node_modules 
server 
src 
deployment 
.gitignore 
angular.json 
azure-pipelines.yml 
buildscript.-s 

Upvotes: 0

Views: 1235

Answers (1)

Blind Despair
Blind Despair

Reputation: 3295

In your angular.json check outputPath. It's set to build atm I suppose. You can replace it with dist and so it will build into dist.

Upvotes: 1

Related Questions