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

feat(@schematics/angular): production builds by default #20128

Merged
merged 3 commits into from
Mar 10, 2021
Merged

feat(@schematics/angular): production builds by default #20128

merged 3 commits into from
Mar 10, 2021

Conversation

alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Feb 24, 2021

With this change we do several changes to the angular.json configuration for build , server and app-shell targets.

  • build, server and app-shell targets are configured to run production by default.
  • We add a new configuration named development to run the mentioned builder targets in development. Ex: ng build --configuration development.
  • When adding universal or app-shell, we generate the full set of configurations as per the buiid target. Previously, we only generated the production configuration.
  • We added a helper script in package.json to run build in watch mode. npm run watch which is a shortcut for ng build --watch --configuration development
  • We deprecated the --prod command line argument. This argument is confusing especially to new users, since users expect that this builds an application in production mode. This however, is only an alias for --configuration="production"

Closes #14471

@google-cla google-cla bot added the cla: yes label Feb 24, 2021
@alan-agius4 alan-agius4 changed the title wip! prod mode by defaulta wip! prod mode by default Feb 24, 2021
@alan-agius4 alan-agius4 changed the title wip! prod mode by default feat(@schematics/angular): production builds by default Feb 26, 2021
@alan-agius4 alan-agius4 added the target: major This PR is targeted for the next major release label Feb 26, 2021
@alan-agius4 alan-agius4 marked this pull request as ready for review February 26, 2021 12:40
@destus90
Copy link
Contributor

@alan-agius4
Shouldn't be added a separator -- after npm run build in order to pass additional options? I guess
npm run buid -- --watch --configuration development

@alan-agius4
Copy link
Collaborator Author

@destus90, yeah indeed, thanks for pointing that out.

With this change we deprecated the `--prod` command line argument. This argument is confusing especially to new users, since users expect that this builds an application in production mode. This however, is only an alias for `--configuration="production"`
@alan-agius4 alan-agius4 requested a review from clydin March 9, 2021 10:16
packages/schematics/angular/app-shell/index.ts Outdated Show resolved Hide resolved
packages/schematics/angular/universal/index.ts Outdated Show resolved Hide resolved
tests/legacy-cli/e2e/tests/build/lazy-load-syntax.ts Outdated Show resolved Hide resolved
@alan-agius4 alan-agius4 requested a review from clydin March 9, 2021 15:39
With this change we do several changes to the `angular.json` configuration for `build` , `server` and `app-shell` targets so that these are `production` by default.

- build, server and app-shell targets are configured to run production by default.
- We add a new configuration named `development` to run the mentioned builder targets in development. Ex: `ng build --configuration development`.
- When adding `universal` or `app-shell`, we generate the full set of configurations as per the `buiid` target. Previously, we only generated the `production` configuration.
- We added a helper script in `package.json` to run build in watch mode. `npm run watch` which is a shortcut for `ng build --watch --configuration development`
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Mar 9, 2021
@filipesilva filipesilva merged commit 55b833c into angular:master Mar 10, 2021
@alan-agius4 alan-agius4 deleted the prod-default branch March 10, 2021 14:26
jessicajaniuk pushed a commit to angular/angular that referenced this pull request Mar 16, 2021
In CLI version 12, we introduced the concept of production builds by default.

With this change we update the documentation to reflect the changes.

More information about the change can be found angular/angular-cli#20128

PR Close #41173
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default to production builds
4 participants