I'm having trouble with the Production Builds section the ClojureScript quickstart. Specifically, when I run: java -cp "cljs.jar;src" clojure.main release.clj
I get a java exception:
Exception in thread "main" java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/dev2/Experiments/cljscript/hello_world/out/cljs/core.js, compiling:(C:\dev2\Experiments\cljscript\hello_world\release.clj:3:1)
I'm doing this on Windows, and I suspect that the google closure compiler doesn't like the windows-style path, specifically the colon. My release.clj is:
(require 'cljs.build.api)
(cljs.build.api/build "src"
{
:output-to "out/main.js"
:optimizations :advanced
})
(System/exit 0)
and I'm invoking it with: java -cp "cljs.jar;src" clojure.main release.clj
. If I comment out the :optimizations line then the build succeeds.
My exact setup is here: https://github.com/PaulRobson/cljs-quickstart
This is a known issue https://dev.clojure.org/jira/browse/CLJS-2401
A workaround involves using an output directory with a hyphen, as in
(require 'cljs.build.api)
(cljs.build.api/build "src"
{
:output-to "out-foo/main.js"
:optimizations :advanced
})
(System/exit 0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With