Skip to content

refactor(@angular/cli): remove compression plugin #4702

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

Merged
merged 1 commit into from
Feb 14, 2017

Conversation

filipesilva
Copy link
Contributor

@filipesilva filipesilva commented Feb 14, 2017

Followup from #4618

BREAKING CHANGE: compressed code (.gz) is no longer generated on production builds.

Copy link
Contributor

@hansl hansl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3 it!

@filipesilva filipesilva merged commit dd5dda6 into angular:master Feb 14, 2017
@filipesilva filipesilva deleted the remove-compression branch February 14, 2017 22:58
@wulfsberg
Copy link

I am a little surprised by this change. One thing I like about Angular-CLI is the way it handles all the steps needed to produce a production-ready deployment output.
I can see why gzipping may not always be appropriate, and as such may not strictly be a core feature of Angular CLI, but it is a step which requires some build tool on top of just naive copying between deployment folders.
This means that we'll have to add yet another build tool to the chain on top of Angular CLI to provide this step; something I am really not fond of.
Are there any plans for re-introducing this as an easy plugin?

@filipesilva
Copy link
Contributor Author

@wulfsberg the reasoning for this change can be found #4618 (comment)

No plans of re-introducing it ourselves. Sounds perfectly possible with the upcoming plugin architecture.

@sebastiannm
Copy link

Would not be better then to remove this feature once it's easy to do with the new plugin architecture?

@rkrzewski
Copy link

#4618 (comment) says that there is an easy workaround and asks for documenting how it can be enabled by end users. Where can I find such information? This PR removed the feature, but did not add any docs AFAICT.
Also, #4702 (comment) mentions "upcoming plugin architecture" does this mean that the mentioned workaround is not possible until that feature lands?

@chouclee
Copy link

At least give us a flag to enable it ╮(╯▽╰)╭

@abcfy2
Copy link

abcfy2 commented Feb 24, 2017

Is there any other ways to compress text files?

@anufryieu
Copy link

anufryieu commented Feb 24, 2017

Hello guys!

I'm using workaround with gulp.

npm install --save-dev gulp
npm install --save-dev gulp-gzip

I added new command into script section of package.json
"build-prod": "ng build -t production -e prod && gulp compress"

And I added gulpfile.js in the root directory (next to the package.json)

var gulp = require('gulp');
var gzip = require('gulp-gzip');

gulp.task('compress', function() {
gulp.src(['./dist/*.js', './dist/*.css'])
.pipe(gzip())
.pipe(gulp.dest('./dist'));
});

I run building via npm run build-prod

Huge thanks @sebastiannm for the note.
Github removes * symbol if I try to do multiline code fragment.
I fixed it.

@sebastiannm
Copy link

Hi @anufriev,

that didn't worked perfectly. But changing to this works:

gulp.src(['./dist/*.js', './dist/*.css'])

@tibbus
Copy link

tibbus commented Feb 27, 2017

oh man, so sad to hear, I loved the gzip feature 😞

@h4b00
Copy link

h4b00 commented Mar 22, 2017

You should guys leave it as special option with additional flag.

@kambbado
Copy link

kambbado commented Apr 3, 2017

@anufriev, did you have to modify the index.html file or the lazy load? I tried your suggestion and I was not able to get it to work.

asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this pull request Apr 12, 2017
@steve-todorov
Copy link

@filipesilva I wasn't able to find any documentation on the new plugin architecture for angular-cli. Is it still in development and if so will it be released soon? So far using ng eject does the job for me but I'm interested in what could be achieved with the plugin architecture :)

@riddla
Copy link

riddla commented Oct 17, 2017

So, what is the "easy workaround" then? #4618 (comment) talks about it but does not explain it ...

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

Successfully merging this pull request may close these issues.