Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modules option is ignored #450

Closed
nashbridges opened this issue Aug 29, 2016 · 5 comments
Closed

modules option is ignored #450

nashbridges opened this issue Aug 29, 2016 · 5 comments

Comments

@nashbridges
Copy link

Here's project.clj:

(defproject hb "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [org.clojure/clojurescript "1.9.216"]
                 [com.cognitect/transit-cljs "0.8.239"]
                 [com.andrewmcveigh/cljs-time "0.4.0"]
                 [cljs-ajax "0.5.7"]
                 [reagent "0.6.0-rc"]]

  :plugins [[lein-figwheel "0.5.6"]
            [lein-cljsbuild "1.1.1"]]

  :clean-targets ^{:protect false} ["lib/assets/cljs/"]

  :cljsbuild {:builds [{:id "front"
                        :source-paths ["cljs/hb"]
                        :figwheel true
                        :compiler {:main "hb.front.core"
                                   :output-to "lib/assets/cljs/cljs-front.js"
                                   :output-dir "lib/assets/cljs/cljs-front.out"
                                   :asset-path "/assets/cljs-front.out"}}

                       {:id "extranet"
                        :source-paths ["cljs/hb"]
                        :figwheel true
                        :compiler {:main "hb.core"
                                   :output-to "lib/assets/cljs/cljs-extranet.js"
                                   :output-dir "lib/assets/cljs/cljs-extranet.out"
                                   :asset-path "/assets/cljs-extranet.out"}}

                       {:id "prod"
                        :source-paths ["cljs/hb"]
                        :compiler {:output-dir "lib/assets/cljs"
                                   :optimizations :advanced
                                   :modules {:front {:output-to "lib/assets/cljs/cljs-front.js"
                                                     :entries #{"hb.front.core"}}
                                             :extranet {:output-to "lib/assets/cljs/cljs-extranet.js"
                                                        :entries #{"hb.core"}}}}}]})

lein cljsbuild once prod seems to ignore this setup:

Compiling ClojureScript...
Compiling "hb/target/cljsbuild-main.js" from ["cljs/hb"]...

However, standalone build.clj works well:

(require 'cljs.build.api)

(cljs.build.api/build "cljs/hb"
                      {:optimizations :advanced
                       :output-dir "lib/assets/cljs"
                       :modules {:front {:output-to "lib/assets/cljs/cljs-front.js"
                                         :entries #{"hb.front.core"}}
                                 :extranet {:output-to "lib/assets/cljs/cljs-extranet.js"
                                            :entries #{"hb.core"}}}})

(System/exit 0)

lein run -m clojure.main build.clj

I've checked similar issue, in my case :modules is under :compiler

@mneise
Copy link
Collaborator

mneise commented Aug 30, 2016

Could you maybe provide an example repo to reproduce this issue?

@nashbridges
Copy link
Author

@mneise
Copy link
Collaborator

mneise commented Sep 23, 2016

Thanks for the repo, very appreciated 😄

Based on your repo it seems that cljsbuild doesn't really ignore the setup. lib/assets/cljs contains the expected modules. One thing that is misleading though is that cljsbuild additionally adds a output-to compiler option per default, which isn't needed here and therefore ends up being empty.

@nashbridges
Copy link
Author

OK, now I see. The log from cljbuild

Compiling ClojureScript...
Compiling "hb/target/cljsbuild-main.js" from ["cljs/hb"]...

was so misleading, so that I never ended up waiting for it to finish.

@mneise
Copy link
Collaborator

mneise commented Jul 5, 2017

Created a follow up issue #467.

@mneise mneise closed this as completed Jul 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants