Skip to content

add webpack-dev-server gzip support #2028

Closed

Description

@xpyanchong

By default config,Use ng serve -prod ,The bundle file too big.

Before

image
image

After

image
image

Need Change

I think this issue is important,Others maybe think the quality of this project is poor.
File addon/ng2/tasks/serve-webpack.ts need add gzip support;
In line 58 Insert ,compress:true

Activity

  1. deebloo commented on Sep 9, 2016

    @deebloo
    Contributor

    @xpyanchong I am curious what your reason for needing gzip in a dev server since it is not the serve you would use in production.

  2. xpyanchong commented on Sep 9, 2016

    @xpyanchong
    Author

    In production i used other webserver.
    I mean when developers use ng server -prod,server should be gzip.
    Developers can predict the production environment.
    Otherwise, why use ng server with prod,just need build then publish to production.
    Most seed project prod mode default open gzip,Include old angular-cli version.

  3. mrgoos commented on Sep 17, 2016

    @mrgoos

    True, I was just about to ask how can I serve a gzipped bundle to prod. I have tried adding ,compress:true (it's line 44 now and under /node_modules/angular-cli/tasks/serve-webpack.js) and it worked but I would want to know how can I pre configure it...? Is it possible? I thought it should be gzipped by default, won't it?

  4. added
    P5The team acknowledges the request but does not plan to address it, it remains open for discussion
    on Sep 22, 2016
  5. achimha commented on Oct 7, 2016

    @achimha

    I think this is more than a nice to have, especially considering how simple a change it is. I am often on slow connections with a remote angular-cli and it makes a tremendous difference.

  6. TheLarkInn commented on Oct 7, 2016

    @TheLarkInn
    Member

    Doesn't this defeat the purpose of a dev environment? Plus also, it is not recommended to use ng serve with --prod node because these files are being transferred and stored in memory. Consider the hashing we put in file names and how that new a problem with an in-memory fs.

  7. achimha commented on Oct 7, 2016

    @achimha

    I agree that ng serve --prod doesn't make a lot of sense but in my opinion having the source code and build environment on a remote machine with SSH and view the web frontend from another devices does make a lot of sense. Think testing on tablets etc.

    In my current app, patching serve-webpack-js to enable gzip compression decreases load times by factor 2-3.

  8. added a commit that references this issue on Oct 10, 2016
    a81bc49
  9. added a commit that references this issue on Oct 17, 2016
    7c13cc5
  10. achimha commented on Oct 17, 2016

    @achimha

    Thanks for the commit. However, I believe combining it with --prod isn't the best solution. First we already concluded that ng serve --prod isn't really a major use case and secondly one spends most of the time in development mode and there major performance gains can be observed by using compression -- in a remote browser scenario.

    I opt for making this a user configurable setting in angular-cli.json.

  11. added a commit that references this issue on Oct 19, 2016
    9410e5a
  12. added a commit that references this issue on Oct 21, 2016
    f15be9e
  13. added a commit that references this issue on Nov 3, 2016
    48c1ea7
  14. angular-automatic-lock-bot commented on Sep 6, 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.

  15. locked and limited conversation to collaborators on Sep 6, 2019
  16. added a commit that references this issue on May 29, 2026
    56ad7b2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P5The team acknowledges the request but does not plan to address it, it remains open for discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions