angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng new build uses --prod

Open derobiom opened this issue 8 years ago • 2 comments

Versions

Angular CLI: 1.6.4 Node: 8.9.1 OS: win32 x64

Repro steps

ng new testprog

Observed behavior

Default build includes "--prod"

{ "name": "testprog", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build --prod", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" },...

Desired behavior

Do not include "--prod"

Generating the project with "build": "ng build --prod" causes production environment variables to be used. Such as, a production api. This is not a good thing. I don't recall "--prod" being the default in older versions of the CLI?

Mention any other details that might be useful (optional)

I was mortified when my app hit the production payments api. No damaged done except to my reputation and my inner child. Both DOA.

derobiom avatar Apr 05 '18 14:04 derobiom

I agree this is an oversight. Better safe than sorry.

hansl avatar Apr 05 '18 14:04 hansl

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.