irundaia / sbt-sassify

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

cscc file in multimodule project copied but not processed #18

Open mslinn opened 7 years ago

mslinn commented 7 years ago

In my multimodule Play webapp, I put the following in modules/cadenza/app/assets/stylesheets/main3.scss:

@import "lib/cadenza/redmond/jquery-ui.css";
@import "lib/cadenza/redmond/jquery.ui.theme.css";
@import "lib/cadenza/css/bootstrap.css";
@import "lib/cadenza/css/bootstrap-datepicker.css";
@import "lib/cadenza/dropzone.css";

I had to modify the @import path recommended by the docs to account for the placement of the lib/ directory in a multimodule project. The following files were output:

./target/web/public/main/stylesheets/main3.css
./target/web/classes/main/META-INF/resources/webjars/cadenza/3.0.0/stylesheets/main3.css
./target/web/sass/main/stylesheets/main3.css

All of the generated files had the @import statements intact, without any expansion.

I then put this line at the top:

@import "lib/compass-mixins/lib/compass";

... but I got:

Error: Functions may not be defined within control directives or other mixins.
        on line 81 of modules/cadenza/target/web/web-modules/main/webjars/lib/compass-mixins/lib/compass/functions/_lists.scss
>>   @function compact($vars...) {
   --^
In /var/work/training/cadenza/modules/cadenza/target/web/web-modules/main/webjars/lib/compass-mixins/lib/compass/functions/_lists.scss:81
77  @return nth($list, 1);
78}
79
80@if not(function-exists(compact)) {
81  @function compact($vars...) { 
82    $list: ();
83    @each $var in $vars {
84        @if $var {
85            $list: append($list, $var, comma);

I tried upgrading to "compass-mixins" % "1.0.2" and that eliminated the error, but still the @import statements were not expanded.

irundaia commented 7 years ago

To be honest I haven't tested with a multimodule project.

@mslinn could you perhaps provide a repo with a minimal example? I'll have a look at it once I get home from my day job.

Thanks for the report!

irundaia commented 7 years ago

Also, just to be sure, which version of sbt-sassify are you using?

mslinn commented 7 years ago

I used sbt-sassify v1.4.6. I'll put a multimodule example together for you tomorrow.

irundaia commented 7 years ago

Great thanks! I think that it might be caused because you're importing css files rather than scss files. I'll have a look whether this compiles with sassc/ruby sass

mslinn commented 7 years ago

I got most of what I wanted working. The project is here. The bottom of the README has a few questions for you.

irundaia commented 7 years ago

I'll have a look at it this evening. Thanks for the example

irundaia commented 7 years ago

I wanted to give an update on this issue. I've checked out the project from the git repo, but SBT seems to stall when running sbt assets (both on Windows and OS X). Unfortunately, I haven't found enough time to figure out why SBT stalls... I'm iteratively removing parts of the build to see which part is blocking SBT