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

add webpack-dev-server gzip support #2028

Closed
xpyanchong opened this issue Sep 9, 2016 · 8 comments
Closed

add webpack-dev-server gzip support #2028

xpyanchong opened this issue Sep 9, 2016 · 8 comments
Assignees
Labels
P5 The team acknowledges the request but does not plan to address it, it remains open for discussion

Comments

@xpyanchong
Copy link

xpyanchong commented Sep 9, 2016

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

@deebloo
Copy link
Contributor

deebloo commented Sep 9, 2016

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

@xpyanchong
Copy link
Author

xpyanchong commented Sep 9, 2016

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.

@mrgoos
Copy link

mrgoos commented Sep 17, 2016

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?

@filipesilva filipesilva added type: enhancement P5 The team acknowledges the request but does not plan to address it, it remains open for discussion labels Sep 22, 2016
@achimha
Copy link

achimha commented Oct 7, 2016

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.

@TheLarkInn
Copy link
Member

TheLarkInn commented Oct 7, 2016

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.

@achimha
Copy link

achimha commented Oct 7, 2016

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.

filipesilva added a commit to filipesilva/angular-cli that referenced this issue Oct 10, 2016
@achimha
Copy link

achimha commented Oct 17, 2016

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.

Brocco pushed a commit that referenced this issue Oct 19, 2016
kieronqtran pushed a commit to kieronqtran/angular-cli that referenced this issue Oct 21, 2016
texel pushed a commit to splice/angular-cli that referenced this issue Nov 3, 2016
@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 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P5 The team acknowledges the request but does not plan to address it, it remains open for discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants