Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between ng build and npm run build #13560

mdufoud1214 opened this issue Jan 31, 2019 · 3 comments


None yet
3 participants
Copy link

commented Jan 31, 2019

am using angular 7 and server side using .net core 2.1
if i do npm run build --prod --aot my dist folder size is around 40mb and my application working as expected,
but if i do ng build --prod --aot my dist folder size is reducing to around 9mb but am not able to run applications some map files are missing getting 404 error(find below screenshot)

i want reduce my bundle size to improve my angular app performance



This comment has been minimized.

Copy link

commented Jan 31, 2019

You need to use —- to pass arguments to npm scripts.
npm run build —- —-prod


This comment has been minimized.

Copy link

commented Feb 4, 2019

@alan-agius4 npm run build —- —-prod it is working as expected , it is reducing dist folder size and application is running ,but where to add this in package.json file

"build-watch": "../@angular/cli/bin/ng build --deploy-url=dist/ --output-hashing all --watch",


This comment has been minimized.

Copy link

commented Apr 30, 2019

Hi, I faced the same issue when having to specify the "base-href" parameter, and the double dash was the solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.