You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However i noticed that ng build --env=prod does work. I believe it doesn't minify the code though. I researched the error and seems to be a webpack issue.
@hassanasad its strange that --env=prod doesn't create production build :).
ng build --env=prod doesn't seem to be a valid command, docs have following as production commands:
ng build --target=production --environment=prod
ng build --prod --env=prod
ng build --prod
ng build createst the same build, so I am not sure if --env=prod is a valid flag or there is some issue with cli.
You're misinterpretting two concepts: env and target. What ng build --prod does is equivalent to ng build --env=prod --target=prod. The --env only dictates which environment file it's using. This allows you to build and debug development code with prod environment.
I'm looking at this. Never seen it before. Is it an open source projet I could repro with?
There's something wrong with your global / local versions of Angular CLI. I got it working locally the first try; literally just git clone, npm install then ng serve.
Activity
billdwhite commentedon Sep 7, 2016
Same here
hassanasad commentedon Sep 8, 2016
Same here.
However i noticed that
ng build --env=proddoes work. I believe it doesn't minify the code though. I researched the error and seems to be a webpack issue.asadsahi commentedon Sep 8, 2016
@hassanasad its strange that --env=prod doesn't create production build :).
ng build --env=prod doesn't seem to be a valid command, docs have following as production commands:
ng build --target=production --environment=prod
ng build --prod --env=prod
ng build --prod
ng build createst the same build, so I am not sure if --env=prod is a valid flag or there is some issue with cli.
coryrylan commentedon Sep 8, 2016
I believe this was an issue with webpack that has been resolved. This should be fixed with the next update.
#2011
hansl commentedon Sep 13, 2016
You're misinterpretting two concepts:
envandtarget. Whatng build --proddoes is equivalent tong build --env=prod --target=prod. The--envonly dictates whichenvironmentfile it's using. This allows you to build and debug development code with prod environment.I'm looking at this. Never seen it before. Is it an open source projet I could repro with?
asadsahi commentedon Sep 13, 2016
@hansl I have upgraded it to RC7, but I think you should be able to replicate this issue from one of my repo. Above error was from the same repo.
hansl commentedon Sep 13, 2016
There's something wrong with your global / local versions of Angular CLI. I got it working locally the first try; literally just
git clone,npm installthenng serve.hansl commentedon Sep 13, 2016
Actually nevermind, just found the error when running prod. Investigating.
hansl commentedon Sep 13, 2016
Okay found the bug. This is already fixed by #1937.
angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.