如何使用自定义初始命名空间启动figwheel?

时间:2016-03-30 11:00:38

标签: clojurescript figwheel

我的clojurescript代码的project.clj指定了:repl-options {:init-ns my-project.core},我通过start-figwheel!启动了figwheel。在图documentation中,它表示

;; 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命名空间。如何让figcar拿起这个选项?

我的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)

我基本上是向Google小组询问this question

1 个答案:

答案 0 :(得分:0)

;; 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` 只启动图轮逻辑。关于你的发现:

:repl-options

它确实找到了它的配置但是here

REPL启动时会使用

figwheel-sidecar.repl-api/cljs-repl。似乎project.clj不允许指定REPL选项,并且它不会从lein repl读取它们。

您可以尝试使用启动:repl-options,其中project.clj的:init使用popoverControllerfornote = [[UIPopoverController alloc] initWithContentViewController:_momVC]; popoverControllerfornote.popoverContentSize = CGSizeMake(self.view.frame.size.width, 80.0); //popoverControllerfornote.autoresizingMask=UIViewAutoresizingFlexibleHeight || UIViewAutoresizingFlexibleWidth; [popoverControllerfornote presentPopoverFromRect:[btn frame] inView:pagebar permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 选项来提供您要执行的代码而不是独立脚本。