irundaia / sbt-sassify

sbt-web plugin for Sass files
Apache License 2.0
68 stars 17 forks source link

assetRootURL override not working #20

Closed johno1985 closed 7 years ago

johno1985 commented 7 years ago

We have a slightly different directory structure in our project. Our assets directory resides under /app/uk.myorg.com/assets.

In our Sbt build file we have set SassKeys.assetRootURL := "/uk.myorg.com". When we build, no css files are generated and nothing is output in the target directory.

irundaia commented 7 years ago

I believe you're misinterpreting the assetsRootUrl setting. This setting only affects the source maps. This is supposed to be the url where the source code will be hosted.

So suppose you've got a main.scss and you're hosting it at your.host.org/foo/main.scss. The assetsRootUrl setting will ensure that the browser can find the source when you're inspecting the original code.

What you're probably looking for, is a way to change the source directory. Since you're assets are in the app/uk.myorg.com/assets, you should include something the following in your build.sbt:

sourceDirectory in Assets := (sourceDirectory in Compile).value / "uk.myorg.com" / "assets"

Note that this assumes that sourceDirectory in Compile points to your app directory. Does this help in solving your problem?

johno1985 commented 7 years ago

Ahh! Yes, thanks Han

On 23 March 2017 at 15:52, Han van Venrooij notifications@github.com wrote:

I believe you're misinterpreting the assetsRootUrl. This setting only affects the source maps. This is supposed to be the url where the source code will be hosted.

So suppose you've got a main.scss and you're hosting it at your.host.org/foo/main.scss.

What you're probably looking for, is a way to change the source directory. Since you're assets are in the app/uk.myorg.com/assets, you should include something the following in your build.sbt:

sourceDirectory in Assets := (sourceDirectory in Compile).value / "uk.myorg.com" / "assets"

Note that this assumes that sourceDirectory in Compile points to your app directory. Does this help in solving your problem?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/irundaia/sbt-sassify/issues/20#issuecomment-288764503, or mute the thread https://github.com/notifications/unsubscribe-auth/ABkJAT2W24twBRIevtPnud4mhI33e2Sjks5ropUygaJpZM4MYnlV .

irundaia commented 7 years ago

That was fast! ^^

You're welcome