Compiled js breaks template function calls

In a template I’m calling a function from the js file

style="background: ${ getColor(zt_value) }"

(code at and this is working fine when I running with the webpack developement server.

But when I build for production this fails with the html simply rendered as

style="background: {}"

I’m not sure what it is that I’m doing differently with the prod build. My prod webpack config is at

Or should I be using a different technique so that the template doesn’t need to call getColor()?

Many thanks,

1 Like

What you need is css= , style attribute is handled by browser natively, aurelia had no chance to peek in the string.


That worked perfectly, thanks.
Strange that it was working with the webpack dev server, so I would never have guessed that I needed css instead.

1 Like