2

我的 clojurescript 代码的 project.clj 指定:repl-options {:init-ns my-project.core},我通过start-figwheel!. 在figwheel文档中它说

;; you can also just call (ra/start-figwheel!)
;; and figwheel will do its best to get your config from the
;; project.clj or a figwheel.edn file`

但是当 figwheel 启动时,它会将我放入cljs.user命名空间。我怎样才能让无花果拿起这个选项?

我的 figwheel.clj 如下所示:

(require '[figwheel-sidecar.repl :as r]
         '[figwheel-sidecar.repl-api :as ra])

(ra/start-figwheel!
  {:figwheel-options {}
   :build-ids ["dev"]
   :all-builds
   [{:id "dev"
     :figwheel {:devcards true}
     :source-paths ["src"]
     :compiler {:main 'my-project.core
                :asset-path "js"
                :output-to "resources/public/js/main.js"
                :output-dir "resources/public/js"
                :verbose true}}]})

(ra/cljs-repl)

我基本上是从谷歌小组问这个问题

4

1 回答 1

0

start-figwheel!只启动无花果逻辑。关于您的发现:

;; you can also just call (ra/start-figwheel!)
;; and figwheel will do its best to get your config from the
;; project.clj or a figwheel.edn file`

它确实找到了它的配置,但它只是:figwheel.project.clj

:repl-optionsREPL 在启动时使用。似乎figwheel-sidecar.repl-api/cljs-repl不允许指定 REPL 选项,也不会从project.clj.

您可以尝试使用lein replwhere project.clj 的:repl-optionsuse:init选项来提供您想要执行的代码而不是独立脚本。

于 2016-04-01T10:54:52.273 回答