-
Notifications
You must be signed in to change notification settings - Fork 26.2k
docs: Deployment guide for CLI #19839
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
Conversation
You can preview 0306819 at https://pr19839-0306819.ngbuilds.io/. |
0306819
to
97dde14
Compare
You can preview 97dde14 at https://pr19839-97dde14.ngbuilds.io/. |
aio/content/guide/deployment.md
Outdated
|
||
Notice the `paths` key: | ||
|
||
For the simplest deployment, build for development and xcopy the output directory to a web server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xcopy
-> copy
aio/content/guide/deployment.md
Outdated
|
||
### Webpack (and AOT) | ||
The remaining [xcopy deployment steps](#xcopy) are the same as before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xcopy
->copy
aio/content/guide/deployment.md
Outdated
Learn more about tree shaking and dead code elmination in | ||
<a href="https://medium.com/@Rich_Harris/tree-shaking-versus-dead-code-elimination-d3765df85c80#.15ih9cyvl" title="Tree-shaking and Dead Code Elimination"> | ||
this post</a> by rollup-creator, Rich Harris. | ||
Building for production (or appending the `--environment=prod` flag) enables _production mode_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--environment=prod
-> --target=prod
These two are actually different: https://github.com/angular/angular-cli/wiki/build#build-targets-and-environment-files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just compared --environment=prod
vs --environment=dev
and they enable/disable prodMod
exactly as I said and expected.
So do --target=production
vs --target=development
. But the --environment
flag is way more intuitive, especially after looking at main.ts
if (environment.production) {
enableProdMode();
}
Why should I change from --environment
to --target
? The wiki page is not helping me understand.
Note that I mention --environment
here only to talk about enableProd
. I'm not talking about any of the other optimizations that would be enabled by --target=production
. So I think this text is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I misunderstood what was being talked about here.
aio/content/guide/deployment.md
Outdated
Bundlers don't know about the router configuration and won't create separate bundles for lazy loaded modules. | ||
You have to create these bundles manually. | ||
The CLI **`ng serve`** command builds, watches, and serves the application from a local development server. | ||
Unlike `build`, **it erases the output directory** and serves the build artifacts from memory instead of from files for a faster development experience. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ng build
also deletes the directory, it just outputs new files there after.
aio/content/guide/deployment.md
Outdated
automatically recognizes lazy loaded `NgModules` and creates separate bundles for them. | ||
If you want to preserve the previously generated files, | ||
append the `-no-delete-output-path` flag to the `serve` command. | ||
Note that the `ng serve` does NOT update generated files as you make changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use ng build --watch
to continuously generate files.
97dde14
to
fd31ace
Compare
You can preview fd31ace at https://pr19839-fd31ace.ngbuilds.io/. |
@@ -482,75 +282,65 @@ The list is by no means exhaustive, but should provide you with a good starting | |||
* [Lite-Server](https://github.com/johnpapa/lite-server): the default dev server installed with the | |||
[Quickstart repo](https://github.com/angular/quickstart) is pre-configured to fallback to `index.html`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will deprecate the quickstart, we shouldn't name it anymore.
fd31ace
to
d64b1fc
Compare
You can preview d64b1fc at https://pr19839-d64b1fc.ngbuilds.io/. |
missing:
|
@vicb the ci failure is a flake and unrelated to this change. |
I fixed the labels. @wardbell please always apply "target" and "merge" label when your pr is ready for merge. |
Yes sorry, I have too many PRs and travis is being flaky all day so I go back and forward restarting them and checking all the statuses. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
See Issue # 19510
PR Checklist
Please check if your PR fulfills the following requirements: