Closed andyparsons closed 9 years ago
Hi!
In one of the projects I'm using Optimus, everything is bundled in an uberjar, and that works fine. It took some effort to get there, though, so might have left something out. It's been a while, so I'll have to look into it. How are you organising your jars?
Two things I notice:
.scss
file. I guess you are using optimus-sass? Are you using some form of includes? Maybe optimus-sass or the library it delegates to are looking for files on the file system?Correct, I am using optimus-sass and there are includes. But doesn't optimus-less have a similar issue, then? I wonder if your uberjar project makes use of optikus-less?
I've edited the stack trace above to include the full trace, which does show references to Optimus.
Yeah, you can see the code here:
https://github.com/DomKM/optimus-sass/blob/master/src/optimus_sass/core.clj#L18
(defn- load-sass-asset [public-dir path]
(let [resource (existing-resource public-dir path)
css (-> resource io/file compile-file)
css-asset (create-css-asset (str/replace path #"\.sass\z|\.scss\z" ".css")
css
(last-modified resource))]
(assoc css-asset :original-path path)))
It loads the scss with io/file
. That won't work in a jar. This is why Optimus uses io/resource
to load files.
I suggest you open an issue with optimus-sass to get this fixed.
Thanks for the diagnosis!
FYI we have switched to optimus-less and everything is working nicely. This can be closed.
:+1:
Optimus is working nicely in our dev environment, but in packages builds we see exceptions like the one below. I've verified, in this case that the jar does contain the indicated file a the expected path.