Skip to content

More production-ready production build #987

Closed

Description

@kylecordes

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...)

Activity

  1. filipesilva commented on Jun 2, 2016

    @filipesilva
    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.

  2. marcalj commented on Jun 3, 2016

    @marcalj

    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

  3. luxueyan commented on Jun 15, 2016

    @luxueyan

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

  4. filipesilva commented on Jul 27, 2016

    @filipesilva
    Contributor

    A lot of these points were introduced in #1455.

  5. kylecordes commented on Jul 27, 2016

    @kylecordes
    Author

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

  6. filipesilva commented on May 22, 2017

    @filipesilva
    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.

  7. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureLabel used to distinguish feature request from other issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions