pierreinglebert / grunt-zopfli-native Goto Github PK
View Code? Open in Web Editor NEWCompress with zopfli grunt task
License: MIT License
Compress with zopfli grunt task
License: MIT License
Trying to compress a file larger than 64KB results in a gz file that can't be unzipped with gunzip and appears truncated (at 65,535 bytes) in browsers. I am seeing this with the latest version of both grunt-contrib-zopfli and grunt-zopfli-native, on 64-bit Fedora and CentOS 6.5.
I have created a minimal project that demonstrates this, and I can share that if you wish, but it may be easier to just say what it does. I have some big files generated with "openssl rand -base64 400000 > bigfile.dat", and then I try to compress that in a Gruntfile with this block:
zopfli: {
main: {
expand: true,
src: ['files/*'],
dest: 'output/'
}
}
The result is a file that is about the same size as the output of the zopfli command-line utility, but which can't be unzipped with gunzip. Here is the output of gunzip:
gzip: bigfile.dat.gz: invalid compressed data--crc error
gzip: bigfile.dat.gz: invalid compressed data--length error
Files under the 64KB mark work just fine.
This is due to Grunt updating to lodash 4.3.0 which removed the alias _.include
in favor of _.includes
in 4.0.0. (grunt.util._
is deprecated and should most likely not be used anyway- the recommended solution is use lodash
directly)
See a similar issue #177 , Task fails due to Warning: grunt.util._.include is not a function for grunt-contrib-compress
The issue cited above has more details to help you resolve this. I don't know how to due that myself or I'd change something myself make a pull request.
Please update grunt-zopfli-native
if you can, I use your module and appreciate it. Thank you.
Why did you feel the need to create this, given that there’s been a grunt-zopfli task for ages? There don’t seem to be any important differences in functionality between the two. What am I missing? Just wondering.
The grunt-contrib
prefix is reserved for officially supported grunt tasks in the grunt org.
Please rename this task to not use the contrib
word both here and on npm.
(I'm on the Grunt team)
Add an option to set the same modified timestamp on gzipped file & raw in order to make gzip static work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.