Paul Byrne
Paul Byrne

Reputation: 1615

Emberjs not picking up Cordova Asset Filename changes for background-image

I’ve an issue with Ember and Cordova and filenames. I am using a template to load a background image for each product in my list of products.

I have for example two files in my assets/images folder, 'logo.jpg', and '8kg.jpg', and the following two lines in my templates.

<img src="images/logo.png" alt="" />

<div class="image" style="background-image:url('images/{{product.imageFilename}}')">

When it interpolates the Handlebars template, the markup looks like this:

<img src="images/logo788888484747499929292347.png">

<div style="background-image:url('images/8kg.jpg')"></div>

The logo loads fine but the div does not find the background image because the file name is no longer correct.

Cordova changes all the actual filenames during build. The filenames after build are 'logo788888484747499929292347.jpg' (or something like this) and aka '8kg234293872fsdfa9e87rawe98f.jpg'.

Is there a way to

1/ Stop Cordova from changing the asset names

Or

2/ Get the Handlebars template to look for the adjusted filename.

Upvotes: 2

Views: 171

Answers (1)

Paul Byrne
Paul Byrne

Reputation: 1615

The answer here was Ember.js fingerprinting.

I excluded the directory.

1 var app = new EmberApp({
2   fingerprint: {
3     exclude: ['images']
5   }

Upvotes: 1

Related Questions