简体   繁体   中英

How can I get figwheel to reload a website when a checkout dependency changes?

I'm working on two related web applications that both depend on a third local project for the code they have in common.

How can I get figwheel to rebuild and reload the code when the checkout dependency is edited?

At the moment, Figwheel doesn't automatically detect leiningen checkouts. You need to add the source paths of your checkout sources directly to your cljsbuild :source-paths . For example, if you had something like

  :cljsbuild {:builds [{:id           "dev"
                        :source-paths ["src" "dev"]
                        :figwheel     {:on-jsload       'my.main/mount-gui}
                        :compiler     {:output-to       ...
                                       :output-dir      ...
                                       :main            'my.main
                                      ...

then you would need to change it to

  :cljsbuild {:builds [{:id           "dev"
                        ;; Add checkouts path here
                        :source-paths ["src" "dev" "checkouts/my-project/src"]
                        :figwheel     {:on-jsload       'my.main/mount-gui}
                        :compiler     {:output-to       ...
                                       :output-dir      ...
                                       :main            'my.main
                                      ...

Once figwheel knows about your checkout project source paths, it should automatically recompile after any changes, and reload the code, as it would for code in your main project.

I'm working on a pull request to fix this issue , which should make it work automatically in the future.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM