grailsasset-pipelinewargrails-2.5

getting grails 2.5.4 asset pipeline excludes to work


I am unable to get either the sass asset pipeline or the less asset pipeline plugin to work, if I am using sass or less imports.

If I only have one sass or less file, grail war works fine.

In my scenario however, file1.scss imports file2.scss, and in the end I only want to end up with a file1.css created from both. This should be possible according to this

https://grails.org/plugin/sass-asset-pipeline

But I am getting this output

| Minifying File 345 of 398 - file2.
| Error WAR packaging error: Stream closed

from grails war --stacktrace --verbose

Both files are in the same directory and have teh following contents:

file1.scss

@import "file2";
.brand {background-color:$mainColor;}

file2.scss

$mainColor:          #277D85;

My build config has this:

plugins = {
    ...
    compile ':asset-pipeline:2.5.7'
    provided ":sass-asset-pipeline:2.9.1"
}

grails.assets.minifyJs = false
grails.assets.minifyCss = false
grails.assets.minifyOptions = [
    optimizationLevel: 'WHITESPACE_ONLY'
]
grails.assets.excludes = ["**/file2.scss"]

What am I doing wrong? How can I get more insights into what's going on here.


Solution

  • Your plugin block should remain in BuildConfig.groovy. However, the rest should be placed in Config.groovy