Skip to content

More production-ready production build #987

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

Closed
kylecordes opened this issue Jun 2, 2016 · 7 comments
Closed

More production-ready production build #987

kylecordes opened this issue Jun 2, 2016 · 7 comments
Labels
feature Issue that requests a new feature

Comments

@kylecordes
Copy link

Feature request: that the production build option produce output that follows many fairly easy "best practices":

  • Concatenate all of the polyfills together, into a file named with a hash of the contents. Every round-trip counts.
  • Ship the application plus the tree shaken libraries in another JS file (already working) again named based on a hash of the contents.
  • Assume that those JS asset files will be permacached - hence the need to name them with a hash, because once a file is shipped it can never be changed under a permacache scheme.
  • Inject the name of these two JavaScript files into the index, rather than the considerably more than 2 we get today even with the -prod option.
  • If the poly-fill file isn't very large, consider combining it with the application and libraries to one JS file total. It is a competitive world, and the other folks can ship their whole thing with a single round trip, we can too.
  • Generate .gz pre-gzipped files also.
  • Offer an option that omits the main libraries (Angular!) from its own output and instead references a well-known CDN - this is sometimes a better approach for widely web deployed software, even though it loses the tree shaking. It would be slick to have this as a simple option while building instead of something to configure oneself.

Something generally like the above (details vary expert by expert) would be a solid baseline for every Angular developer to have immediately available in the CLI. A high percentage of Angular projects may then need no build tooling at all beyond the CLI.

(Something I would love to see, but it's probably a crazy amount of scope: automatically use "universal" to generate HTML for the first screen, then "CSS shake" to get the minimum CSS for this first screen, and include both of the above directly in the HTML, therefore providing a very high score for "Google page speed" for Angular apps managed using the CLI. This would be bliss. I am just dreaming, not requesting this feature...)

@filipesilva
Copy link
Contributor

I'm not personally ready to work on this right now, nor able to say what is going to happen from that list, but think it's a good list to start with to guide feature design.

@marcalj
Copy link

marcalj commented Jun 3, 2016

The CDN option and multiple files won't be an issue for me if the CLI adds automatic support for Service Workers, plus a way to customize it with extra code.

I'm also worried about minifying images (png, jpg, svg, etc).

I really want to use it but I didn't migrate completely to Angular 2, and my current build project is based on old yeoman angular generator with lots of tiny refactors... :P

@luxueyan
Copy link

" into a file named with a hash of the contents." This feature is important!

@filipesilva
Copy link
Contributor

A lot of these points were introduced in #1455.

@kylecordes
Copy link
Author

Once I try out the new stuff, I'll post a comment with a new, shorter list!

@filipesilva
Copy link
Contributor

Heya, I'm closing this issue as obsolete since some of these items have been addressed so far and others are not feasible anymore or we don't plan to add them (like optional CDN).

Please open individual issues for specific requests that you'd still like to see in the CLI.

@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 Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Issue that requests a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants