ember-cli / broccoli-asset-rev

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

feature request: disable prepend for some files, but keep fingerprinting #95

Open Leooo opened 8 years ago

Leooo commented 8 years ago

Hello, my use case is the following: using web workers with Ember:

this.worker=new Worker("assets/workers/worker_ls_serializer.js")

For the files in my workers folder that I call with importScripts, I have to disable prepending the CDN because of CORS issues for worker scripts (has to be the same domain), so I'm using exclude: ['worker'] though we need to still keep the fingerprinting for normal version control.

for reference: https://github.com/ember-cli/ember-cli/issues/1011 http://stackoverflow.com/questions/24175120/ember-cli-project-and-web-workers/36529757#36529757 Thanks,

L

rickharrison commented 8 years ago

For full disclosure, this is not something I will have the time to work on anytime soon. If this is a feature you need, please submit a pull request.

Leooo commented 8 years ago

will try rick, thanks

PratheepV commented 7 years ago

@Leooo , Any chance you tried it. Please share. We are also looking for same.

Leooo commented 7 years ago

@PratheepV no I didn't have the time to sort that out, copy/pasting the whole file I need (localforage) in each worker for now to go around this issue, which is very ugly. Anyone with a PR for this would be great thanks.

jembezmamy commented 7 years ago

I need something exactly opposite (keep prepending and disable fingerprint for some files). I've got files that are used by external services, so they cannot be fingerprinted and at the same time I reference them in my code, so these references should get prepended with a domain name.

Maybe I can prepare a PR, but not now, I'll think about it next week.

mangatinanda commented 7 years ago

@jembezmamy did you find a way to disable fingerprint for some files but not prepending?

mangatinanda commented 7 years ago

As a workaround, I have used broccoli-asset-rewrite for prepending.

jembezmamy commented 7 years ago

@mangatinanda Sorry, I forgot about this issue. Our workaround involves creating symbolic links on the server, so i.e. embed.js would be accessible also without fingerprint:

ln -s embed*.js embed.js

And then generating URLs for these files manually:

`<script src="${ENV.assetHost}assets/embed` + `.js" async></script>`

But this solution is good only if you have only few files to exclude from fingerprinting. On a bigger scale it would be a mess.