How to specify asset urls after baseUrl deprecation?
Hey!
After fixing the baseUrl deprecation I've got the problem that specifying the urls for assets in a scss file becomes quite tricky. In our setup I know the baseUrl (or nowadays the rootURL) at build time and not when I write the scss file. I opened a thread on discuss.emberjs.com for more details click here.
I also built a "hacky" solution which works fine for us but I'm interested what would be a good approach to solve this problem. Are there any plans in solving this issue within ember-cli-sass?
Thanks a lot
I have also had similar problems with this, after digging a little bit I found this approach to use the function feature of sassOptions:
https://stackoverflow.com/questions/33025880/is-it-possible-to-pass-environment-variables-to-ember-cli-sass-during-build
This let me pass through an environment option that I could use for my asset URLs, you could possible do something similar with rootURL if you needed to:
$rootURL: '';
@if environment() == 'development' {
$rootURL: '/foobar';
}
.image {
background: url('#{$rootURL}/images/images.png');
}