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

Using customHash has returned to prepending multiple times again #99

Open
typeoneerror opened this issue Jul 17, 2016 · 7 comments
Open

Comments

@typeoneerror
Copy link

typeoneerror commented Jul 17, 2016

(note: closed ember-cli/broccoli-asset-rewrite#43 in favor of this issue)

Updated to latest and assets are now getting "assets" three times when using customHash and prepend.

in:
<img src="assets/icons/stripe.svg">
out:
<img src="http://localhost:4200/assets/assets/assets/icons/stripe.svg">

  var fingerprintOptions = {
    enabled: true,
    extensions: ['js', 'css', 'png', 'jpg', 'gif', 'map', 'svg'],
    generateAssetMap: true,
    prepend: 'http://localhost:4200/',
    customHash: null,
    generateAssetMap: false
  };

Looks specific to customHash again (removing that fixes again) and may be related to #87

@typeoneerror
Copy link
Author

FYI, the assetMap generated when generateAssetMap: true looks correct, so this may be an ember-cli issue.

@bichotll
Copy link

bichotll commented Aug 4, 2016

The same over here :/

@bichotll
Copy link

bichotll commented Aug 5, 2016

Hi @typeoneerror, any solution or at least workaround regarding this? ;)

I needed for a commercial project, I'm afraid :/

@typeoneerror
Copy link
Author

@bichotll I didn't have any issues with production builds, it was only when I had customHash: null and generateAssetMap: false set in development build that it fails like this. So workaround is to just not use customHash at all locally and deal with the hash output on the dist files.

@rickharrison
Copy link
Collaborator

A failing test case would be really helpful in debugging this!

@grayt0r
Copy link

grayt0r commented Oct 3, 2016

I ran into this issue and in the process of trying to create a failing test case realised, for me at least, that's it's actually caused by an open issue on broccoli-asset-rewrite: ember-cli/broccoli-asset-rewrite#39.

We reference the same relative image URL a few times in our CSS and each of those references appears to be rewritten multiple times, resulting in assets/ appearing in the path multiple times. This only happens when customHash: null is specified as if the file is fingerprinted then after the first rewrite the path will no longer match the fingerprint regex.

Happy to provide a failing test for the broccoli-asset-rewrite repo, but believe the test in the proposed PR to fix the issue linked above covers the same scenario.

@rickharrison
Copy link
Collaborator

Yes, that would be great if you had a failing test case over there.

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

4 participants