ember-cli / broccoli-asset-rev

Broccoli plugin to add fingerprint checksums and CDN URLs to your assets
MIT License
86 stars 83 forks source link

Feature request: allow prepend but disable hash #49

Closed Truffula closed 9 years ago

Truffula commented 9 years ago

I'm using broccoli-asset-rev to create a build be placed in versioned folder (for use with ember-cli-deploy) and which will be deployed on multiple servers, so I'd like to be able to use the prepend functionality for adding the hostname, but not add hashes to the end of files. If customHash returns empty string or null, I still get a hyphen appended, or -null respectively. It would be helpful if the hyphen was only added if customHash returned a non-empty string.

rickharrison commented 9 years ago

I think this could be fixed by doing something like if (this.hasOwnProperty('customHash').

Would you mind testing it out and submitting a PR?

Truffula commented 9 years ago

Will see what I can do!

chrislopresto commented 9 years ago

We need something similar. We are simulating production environment asset hosting in dev. We want to prepend a different fqdn without appending a hash (for dev only).

@rickharrison Would you be open to a new config option to disable the hash? Something like hashEnabled defaulted to true. In our case, we could then set this to false in dev.

Thoughts?

rickharrison commented 9 years ago

I'd like to accomplish this by providing null as the customHash. A PR would be great to accomplish this.

calebboyd commented 9 years ago

I submitted a PR for this. It seems to help significantly for build/rebuild time in dev environments (setup as @chrislopresto explained).

rickharrison commented 9 years ago

Added in 2.0.4

chrislopresto commented 9 years ago

Works like a charm. Thanks @calebboyd @rickharrison

chrislopresto commented 9 years ago

@calebboyd @rickharrison FYI, we came across a problem in broccoli-asset-rewrite. It wasn't respecting the prepend option for our source maps in the dev config I mentioned here. Just put up this PR: https://github.com/rickharrison/broccoli-asset-rewrite/pull/17

calebboyd commented 9 years ago

Hah, nice find. That helps me out too!