Skip to content

Commit 5d64c2a

Browse files
committed
CLJS-3209: With clojurescript 1.10.597 HelloWorld compiled with to 94K of JS with advanced optimizations turned on
Switch = to identical? in Node.js target check at bottom of core.cljs. Add test case to check for file size regressions.
1 parent 470e91e commit 5d64c2a

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:jvm-opts ^:replace ["-Dclojure.compiler.direct-linking=true" "-Xmx512m" "-server"]
88
:source-paths ["src/main/clojure" "src/main/cljs"]
99
:resource-paths ["src/main/cljs" "resources"]
10-
:test-paths ["src/test/clojure" "src/test/cljs" "src/test/self" "src/test/cljs_cp"]
10+
:test-paths ["src/test/clojure" "src/test/cljs" "src/test/self" "src/test/cljs_build" "src/test/cljs_cp"]
1111
:dependencies [[org.clojure/clojure "1.10.0-alpha4"]
1212
[org.clojure/spec.alpha "0.1.143"]
1313
[org.clojure/core.specs.alpha "0.1.24"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(ns trivial.core)
2+
3+
(. js/console (log "Hello!"))

src/test/clojure/cljs/build_api_tests.clj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,3 +703,16 @@
703703
sha (string/lower-case (util/content-sha (slurp (io/file f)) 7))]
704704
(is (true? (.exists f)))
705705
(is (string/includes? (.getPath f) sha))))))))
706+
707+
(deftest cljs-3209-trivial-output-size
708+
(let [out (.getPath (io/file (test/tmp-dir) "3209-test-out"))
709+
out-file (io/file out "main.js")
710+
{:keys [inputs opts]} {:inputs (str (io/file "src" "test" "cljs_build"))
711+
:opts {:main 'trivial.core
712+
:output-dir out
713+
:output-to (.getPath out-file)
714+
:optimizations :advanced}}
715+
cenv (env/default-compiler-env)]
716+
(test/delete-out-files out)
717+
(build/build (build/inputs (io/file inputs "trivial/core.cljs")) opts cenv)
718+
(is (< (.length out-file) 10000))))

0 commit comments

Comments
 (0)