Wednesday, 19 October 2022

Angular build for production npm run build vs ng build

 https://forum.ionicframework.com/t/difference-betwen-npm-run-build-ng-build-and-ionic-build/187122


npm run build and ng build are the same thing, npm run build picks the "build" from package.json



build for production 

1) ng build --configuration production (this uses enviroment.prod.ts file)

or 

2) ng build (uses enviroment.ts, you can copy production config here)


remove logger on production 

in enviroment.prod.ts

:

    logger: {

        apiUrl: '', // Replace with local API

        logLevel: NgxLoggerLevel.ERROR,

        serverLogLevel: NgxLoggerLevel.ERROR,

    },

No comments:

Post a Comment