Skip to content

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

Merged
filipesilva merged 1 commit into
angular:masterfrom
filipesilva:remove-compression
Feb 14, 2017
Merged

filipesilva merged 1 commit into
angular:masterfrom
filipesilva:remove-compression

Conversation

@filipesilva

@filipesilva filipesilva commented Feb 14, 2017 •

Copy link
Copy Markdown
Contributor

Followup from #4618

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

@hansl hansl left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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

@rkrzewski

Copy link
Copy Markdown

#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
Copy Markdown

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

@abcfy2

abcfy2 commented Feb 24, 2017

Copy link
Copy Markdown

Is there any other ways to compress text files?

@anufryieu

anufryieu commented Feb 24, 2017 •

Copy link
Copy Markdown

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
Copy Markdown

Hi @anufriev,

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

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

@tibbus

tibbus commented Feb 27, 2017

Copy link
Copy Markdown

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

@h4b00

h4b00 commented Mar 22, 2017

Copy link
Copy Markdown

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

@kambbado

kambbado commented Apr 3, 2017

Copy link
Copy Markdown

@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
Copy Markdown

@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

riddla commented Oct 17, 2017

Copy link
Copy Markdown

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

@angular-automatic-lock-bot

Copy link
Copy Markdown

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.