Figwheel没有编译所有文件

时间:2017-06-28 16:57:37

标签: clojure clojurescript figwheel

我有一个具有服务器cljsbuilds的project.clj文件,而Figwheel似乎只是编译第一个。有什么想法吗?

project.clj看起来像这样:

(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}}}}}}})

我正在使用看起来像这样的脚本运行Figwheel:

(use 'figwheel-sidecar.repl-api)
(start-figwheel!) ;; <-- fetches configuration
(cljs-repl)

1 个答案:

答案 0 :(得分:2)

虽然您问过如何将其传递给脚本,但我通常倾向于在配置中显示(在顶级:figwheel条目中):

:figwheel { :builds-to-start ["dev" "test"] }

Also see the docs:

  

您希望figwheel开始构建的构建ID向量   当你没有参数调用lein figwheel时。