I have a project.clj file that has sever cljsbuilds and Figwheel seems to only be compiling the first one. Any ideas why?
The project.clj looks like this:
(defproject tech.projectx/clients "0.1.0-SNAPSHOT"
:cljsbuild {:builds {:renderer {:source-paths ["src/renderer" "src/common"]
:compiler {:output-to "app/renderer/renderer.js"
:output-dir "app/renderer"
:asset-path "renderer"
:main configurator.core
:language-in :ecmascript5
:optimizations :none}}
:main {:source-paths ["src/main" "src/common"]
:compiler {:output-to "app/main/main.js"
:output-dir "app/main"
:asset-path "main"
:main tech.projectx.main
:target :nodejs
:externs ["node_modules/closurecompiler-externs/path.js"
"node_modules/closurecompiler-externs/process.js"]
:optimizations :simple}} ; without this, the packed application doesn't work.
:renderer-test {:source-paths ["src/renderer" "src/common" "test/renderer"]
:compiler {:output-to "test-app/renderer/renderer.js"
:output-dir "test-app/renderer"
:asset-path "renderer"
:main clientcommon.test-runner
:language-in :ecmascript5
:optimizations :none
:source-map true
:source-map-timestamp true
:pretty-print true}
:figwheel {:websocket-host "localhost"
:on-jsload "clientcommon.test-runner/run-all-tests"}}
:test-app-main {:source-paths ["test/main" "src/main" "src/common"]
:compiler {:output-to "test-app/main/main.js"
:output-dir "test-app/main"
:asset-path "main"
:main tech.projectx.test-app-main
:target :nodejs
:externs ["node_modules/closurecompiler-externs/path.js"
"node_modules/closurecompiler-externs/process.js"]
:optimizations :none
:source-map true
:source-map-timestamp true
:pretty-print true}}}}
:sass {:source-paths ["src/renderer/assets"]
:target-path "app/renderer/assets"
:source-map true}
:figwheel {:server-logfile "log/figwheel-logfile.log"
:css-dirs ["app/renderer/assets"]}
:profiles {:dev {:cljsbuild {:builds {:renderer {:compiler {:source-map true
:source-map-timestamp true
:pretty-print true}
:figwheel {:websocket-host "localhost"
:on-jsload "configurator.core/mount-root"}}
:main {:compiler {:source-map "app/main/main.js.map"
:source-map-timestamp true
:pretty-print true}}}}}
:prod {:cljsbuild {:builds {:renderer {:compiler {:optimizations :simple
:closure-defines {goog.DEBUG false}}}
:main {:compiler {:optimizations :simple
:closure-defines {goog.DEBUG false}}}}}}})
I'm running Figwheel with a script that looks like this:
(use 'figwheel-sidecar.repl-api)
(start-figwheel!) ;; <-- fetches configuration
(cljs-repl)
Although you asked, how to pass it to the script, I usually tend to manifest that in the config (in the top level :figwheel
entry):
:figwheel { :builds-to-start ["dev" "test"] }
A vector of build ids that you would like figwheel to start building when you invoke lein figwheel without arguments.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.