Munter / netlify-plugin-hashfiles

Netlify build plugin to get optimal file caching with hashed file names and immutable cache headers
BSD 3-Clause "New" or "Revised" License
32 stars 2 forks source link

Hashing a JS file undoes minification #134

Open arpancj opened 4 years ago

arpancj commented 4 years ago

I have a svelte file that is compiled using rollup, and the final stage includes magnification using terser().

This works perfectly, until I add the hash files plugin -- when this is run, it undoes the magnification step and reformats the JS file -- almost doubling the file size.

Is there a reason this is happening and is there a way to prevent this from happening?

Munter commented 4 years ago

This seems like a bug. We should strive to keep original files unchanged as much as possible. The train this happens is probably that the pretty print defaults to true and I forgot about it. Let's treat this as a bug

arpancj commented 4 years ago

Thanks for confirming -- I thought it might have something to do with the parsing or linting.

Had earlier spent a couple hours trying to debug my deploy script before I realized it was the build plugin doing it. 🤦‍♂️ Very useful plugin though -- was using a custom hashing script, but yours is so much faster than my hacky code.

dan-dr commented 2 years ago

Is this fixed?