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

assetMap keys mysteriously also end up fingerprinted #127

Open FelixAkk opened 6 years ago

FelixAkk commented 6 years ago

Hi, I'm kind of lost looking for the origin of a specific problem. Any tips would be much appreciated!

The problem

The asset map is supposed to be original file paths as keys and the fingerprinted file paths as values. However in my setup (ember-cli@3.14 and broccoli-asset-rev@2.7.0) they are both fingerprinted, like this:

Symptom

assets/assetMap.json

{
  "assets": {
    "assets/assetMap-0a44e35a1e3c8f7d9a47daebc0c9982d-70f2499612cdd7ad97c2c1ea906011ce.json": "assets/assetMap-0a44e35a1e3c8f7d9a47daebc0c9982d-70f2499612cdd7ad97c2c1ea906011ce.json",
    "assets/assetMap-5bb51518a6cb320cc449d9cefeaa013b.json": "assets/assetMap-0a44e35a1e3c8f7d9a47daebc0c9982d-70f2499612cdd7ad97c2c1ea906011ce.json",
    "assets/feedbackfruits-c3a921b164bc7b188050bd95294d81b9.css": "assets/feedbackfruits-c3a921b164bc7b188050bd95294d81b9.css",
    "assets/feedbackfruits-c3a921b164bc7b188050bd95294d81b9.css-71651606cee8e5aaaee0a40e5cfe279c.map": "assets/feedbackfruits-c3a921b164bc7b188050bd95294d81b9.css-71651606cee8e5aaaee0a40e5cfe279c.map",
    "assets/feedbackfruits-694083976caaef79ec066a43a11866ba.js": "assets/feedbackfruits-694083976caaef79ec066a43a11866ba.js",
    "assets/feedbackfruits-ff41bb74ae0dc58507d8daee9b4e1e24.map": "assets/feedbackfruits-ff41bb74ae0dc58507d8daee9b4e1e24.map",

Diagnosing

I've tried with various options on/off like assetMapFingerprinting or checking if railsStyleManifest maybe doesn't suffer from this (it also does). The related tests here still pass tho and checking a fresh ember CLI setup also doesn't display this, so it seems there's something to my setup that causes this.

Any ideas? Tips on how to further diagnose this would already help! :)

joankaradimov commented 5 years ago

With the duplicate assetMap keys in assetMap.json this might be somehow related to https://github.com/rickharrison/broccoli-asset-rev/issues/122. I have created https://github.com/rickharrison/broccoli-asset-rev/pull/130, which fixes it.

I am unable to reproduce the issue described here, but it might be worth checking if the PR fixes this too.