ember-cli / ember-cli/broccoli-asset-rewrite

doesn't handle multiple references to the same URL

Open
#39 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
10
Forks
50
PR merge metrics
No merged PRs in 30d

Description

Given the input

``` CSS
.sample-img-small { width: 50px; height: 50px; background-image:url(/images/defs.svg#plus) }
.sample-img-medium { width: 80px; height: 80px; background-image:url(/images/defs.svg#plus) }
.sample-img-large { width: 120px; height: 120px; background-image:url(/images/defs.svg#plus) }
.sample-img-xlarge { width: 240px; height: 240px; background-image:url(/images/defs.svg#plus) }
```

with options

``` Javascript
{
assetMap: {
'images/defs.svg': 'assets/images/defs.svg'
},
prepend: 'https://cloudfront.net/'
}
```

Expected:

``` CSS
.sample-img-small { width: 50px; height: 50px; background-image:url(https://cloudfront.net/assets/images/defs.svg#plus) }
.sample-img-medium { width: 80px; height: 80px; background-image:url(https://cloudfront.net/assets/images/defs.svg#plus) }
.sample-img-large { width: 120px; height: 120px; background-image:url(https://cloudfront.net/assets/images/defs.svg#plus) }
.sample-img-xlarge { width: 240px; height: 240px; background-image:url(https://cloudfront.net/assets/images/defs.svg#plus) }
```

Actual:

``` CSS
.sample-img-small { width: 50px; height: 50px; background-image:url(https://cloudfront.net/assets/assets/assets/assets/assets/assets/assets/assets/images/defs.svg#plus) }
.sample-img-medium { width: 80px; height: 80px; background-image:url(https://cloudfront.net/assets/assets/assets/assets/assets/assets/assets/assets/images/defs.svg#plus) }
.sample-img-large { width: 120px; height: 120px; background-image:url(https://cloudfront.net/assets/assets/assets/assets/assets/assets/assets/assets/images/defs.svg#plus) }
.sample-img-xlarge { width: 240px; height: 240px; background-image:url(https://cloudfront.net/assets/assets/assets/assets/assets/assets/assets/assets/images/defs.svg#plus) }
```

(note the 8 nested `assets` folders)

I have a failing test, working on a PR now...

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.