-
Notifications
You must be signed in to change notification settings - Fork 109
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
Don't automatically add "ext" options as it makes it impossible to keep original filename #91
Conversation
existing extension without issue (see gruntjs#79) if the user wishes to add an extension they can do so via ext or rename.
@netpro2k Can you fix the failing tests please? |
Updated the tests to not expect any extensions. Thought about adding a test for extensions, but this should be covered already in tests for the grunt file API. |
👍 to this PR. I have the same issue where I want to upload compressed files to my CDN without renaming them to |
Sorry for the delay on this everyone. @netpro2k, this would be a minor version bump (to 0.8) as it breaks backwards compat. Could you please add some documentation to /docs/compress-overview.md for people upgrading from the old behavior to the new? As soon as that is in I will get this merged and published. |
How is the progress with this pull request? It would let me clean up my Gruntfile quite a lot. :) Thanks! |
@moodh we're just waiting on a rebase and some docs. If you wanted to clean up the branch and open a new PR it would be merged! |
For anyone who wants to prevent their compressed files automatically getting renamed to the ".gz" extension, simply add
|
@tgumz worth noting, that only works if the source and destination is different folders, otherwise they all end up (with the correct extension) as 20byte files. Hopefully this pull request fixes that. =) |
Any other changes this needs @tkellen? |
Nope! Sorry about the wait here ya'll. @netpro2k in the future, please don't increment versions in your PRs--it often causes needless conflicts when the version changes after a PR has been made. Also, many projects have a specific workflow for cutting releases. |
In the wild as 0.10 |
There's a side effect as a consequence of that change and it may be quite confusing. Bear with me, please. If you have a file named compress: {
options: {
mode: 'gzip'
},
all: {
expand: true,
cwd: 'public/scripts',
src: '**/*.js',
dest: 'public/scripts'
// notice `ext` was not provided
},
} Now, with the merged change, the default behavior in that case would be to overwrite My solution/workaround was to use: ext: function (ext) { return ext + '.gz'; } |
As per discussion in #79