Open venantius opened 9 years ago
This issue was resolved for me by the steps detailed in https://github.com/emezeske/lein-cljsbuild/issues/366#issuecomment-134230350
I lied. Cljsbuild still doesn't overwrite existing compiled js during an uberjar build.
Taking a look at this now :wink:
Not able to reproduce this yet. Could you maybe provide a minimal repository to reproduce this issue?
So, after a bit of work, my running hypothesis is that Cljsbuild won't try to re-compile js if it finds the existing file, in this case "resources/public/js/app.js"
I can work on putting together a minimal test case to further drill in on this, but by looking at the actual files that my uberjar contained as I tweaked various aspects of the build system the only thing that caused files to be included in the uberjar was nuking the entirety of the resources/public/js folder, and critically that file.
@venantius Did you find any solution to this issue? Indeed, removing "resources/public/js/app.js" does the trick. However, this is not an elegant solution at all.
@psalaberria002 The other thing I found that helped was adding the build path to leiningen's :clean-targets
The reason it doesn't recompile is that lein-cljsbuild only recompiles if the sources have been modified since the last build. I'm currently not aware of another solution, other than running lein clean
or using different output files for different builds.
I think for 2.0 I will probably remove this behaviour, since ClojureScript itself is pretty good when it comes to incremental builds.
That's interesting. I think using the plugin to force cleaning of the compilation target directory prior to uberjar compilation is probably the desirable / "expected" behavior here.
Anyways, happy that we've been able to nail this down as something warranting investigation rather than a "can't-reproduce" ^.^
I have the same problem. If I change my cljsbuild
configuration, then I have to remove app.js
in order to force lein cljsbuild once
to do anything.
I'm relatively new to Cljs, but not to Clojure, and this behavior has been confusing to me. I have a project.clj as follows:
If I've been running figwheel for a while in development, but I stop and then run
lein uberjar
, my ClojureScript code is not re-compiled for the different uberjar profile, meaning my uberjar now ships with application code that tries to open a figwheel connection.If I manually delete
/resources/public/js/app.js
and trigger a re-compile by runninglein with-profile uberjar cljs build once
, then runlein uberjar
, the jar file has the correct javascript file (no figwheel connection attempted).