Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finger-printing assets in production builds #40

Open
mattmarcum opened this issue Jun 21, 2019 · 2 comments
Open

finger-printing assets in production builds #40

mattmarcum opened this issue Jun 21, 2019 · 2 comments

Comments

@mattmarcum
Copy link

I noticed that when I do a production build my web-workers/*.js get fingerprinted...however the worker service isn't aware that the worker filenames are changed so we get a 404. I fixed it by adding a fingerprint: { exclude: ['web-workers']} to my ember-cli-build.js, but I think it might be good to support fingerprinting of the worker js files. Any ideas?

@mattmarcum
Copy link
Author

mattmarcum commented Jun 25, 2019

so this seems to work:

    //leave this for fingerprinting - the string gets replaced with the fingerprinted filename
    let workerFilename =  "assets/web-workers/sha.js"
      .replace('assets/web-workers/','')
      .replace('.js','');

    try {
      file.hash = yield this.worker.postMessage(workerFilename, file.blob)
    } catch(err) {...}

because broc-asset-rev searches your files and automajically updates filename strings with the fingerprinted filenames

@adrigzr
Copy link
Contributor

adrigzr commented Jun 26, 2019

Hi @mattmarcum,

Nice to know! Maybe we can add this solution to our README. Thanks for pointing it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants