-
Notifications
You must be signed in to change notification settings - Fork 114
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
Compressing several files #26
Comments
This should be what you're looking for: http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically |
Hi Tkellen, Thanks for the reply. I'm familiar with building the file object dynamically, but when I do it in the way that I am familiar with, I get an error that no archive is specified. In case I wasn't clear, I am looking to individually compresses all files in a given directory (so for each foo.txt there will be a foo.txt.gz next to it). This is pre-compression to use with nginx gzip_static feature. Can you please help me understand what configuration will achieve this? Right now I have the following configuration and it does not work.
Thanks! |
Mode auto-detection is handled by the Please try: compress:
dist:
expand: true
cwd: 'dist/'
src: ['**/*.js', "**/*.css", "**/*.html"]
dest: 'dist'
ext: '.gz'
options:
mode: 'gzip' |
I tried that configuration, and I got the following error message
|
You're right. The gzip mode for this task is totally borked. I'll take a look at fixing it soon. |
Thanks! |
@evanworley This should be fixed now on |
Thanks for the quick fix. It works for the happy path case, but not when you have empty files. Please see my comment in c1c21e5 |
Fixed and published as v0.4.3. Thanks again! |
How can this be used to recursively compress all files in a directory?
For example, I want to generate compressed versions of all my assets along side their uncompressed version.
Thanks,
Evan
The text was updated successfully, but these errors were encountered: