Skip to content

Commit 197ff2e

Browse files
anmonteirodnolen
authored andcommitted
CLJS-1964: Validate that :target :nodejs and no optimizations requires a :main option to be present
1 parent 2171ae9 commit 197ff2e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/clojure/cljs/closure.clj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,9 @@
18701870

18711871
(defn check-node-target [{:keys [target optimizations] :as opts}]
18721872
(assert (not (and (= target :nodejs) (= optimizations :whitespace)))
1873-
(format ":nodejs target not compatible with :whitespace optimizations")))
1873+
(format ":nodejs target not compatible with :whitespace optimizations"))
1874+
(assert (not (and (= target :nodejs) (= optimizations :none) (not (contains? opts :main))))
1875+
(format ":nodejs target with :none optimizations requires a :main entry")))
18741876

18751877
(defn check-preloads [{:keys [preloads optimizations] :as opts}]
18761878
(when (and (some? preloads) (not= optimizations :none))

0 commit comments

Comments
 (0)