broccoli-asset-rev icon indicating copy to clipboard operation
broccoli-asset-rev copied to clipboard

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

Open Leooo opened this issue 8 years ago • 8 comments

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

Leooo avatar Apr 10 '16 15:04 Leooo

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.

rickharrison avatar Apr 11 '16 16:04 rickharrison

will try rick, thanks

Leooo avatar Apr 20 '16 21:04 Leooo

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

PratheepV avatar Aug 14 '16 06:08 PratheepV

@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.

Leooo avatar Aug 14 '16 12:08 Leooo

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.

jembezmamy avatar Jan 03 '17 12:01 jembezmamy

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

mangatinanda avatar May 10 '17 06:05 mangatinanda

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

mangatinanda avatar May 10 '17 08:05 mangatinanda

@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.

jembezmamy avatar May 14 '17 09:05 jembezmamy