I am new to clojurescript.
Is it normal to have a javascript file of "77 KB" after advanced compilation?
I have one clojurescript file:
I am using leinigen: lein cljsbuild once
(ns my-staff.core)
(defn ^:export main []
(.write js/document "<p>Hello from my_staff.core.main()</p>"))
(defproject my-staff "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.4.0"]
[org.clojure/clojurescript "0.0-1586"]]
:source-paths ["src-clj"]; source path for clojure
:plugins [[lein-cljsbuild "0.3.0"]]
:cljsbuild {
:builds [{
:source-paths ["src-cljs"]
:compiler {
:output-to "public/javascripts/main.js"
:optimizations :advanced
:pretty-print false}}]})
Yes, that's normal. The Google Closure compiler has trouble optimizing some of the code that the clojurescript compiler currently emits. This is expected to improve over time. Check CLJS-257 for progress.
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