I'm trying to write a simple Cakefile build script for a small javascript library. I'd like to gzip a source string and write the result to a file. Here's what I have so far:
zlib.deflate minifiedjavaScriptSource, (error, buffer) ->
fs.writeFileSync(javascript_destination_gzipped_minified_path, buffer)
When I run the script, it generated a .gz
file as expected. However, when I decompress this file, I get a .cpgz
file. If I try and decompress that, it just generates the original file again. What am I doing wrong?