figwheel-main

figwheel-main http://figwheel.org
damian 2020-07-24T14:02:25.129400Z

Hello! First of all, thanks for your great work! I have a problem with configuring :mode :serve though. The documentation says:

If you want to start a Figwheel build without a REPL you will need to ensure that the :mode option is :serve. You can do this in the metadata in the build file or you can supply a replacement for the figwheel-main.edn [...]
So first I tried modifying my figwheel-main.edn:
{:open-url false
 :mode :serve}
Then I run either lein fig -- --build dev or (figwheel.main.api/start "dev") from the repl. And I can see that the config file is ok because :open-url false truly works as expected. But it still doesn't go to the :serve mode. Then I tried to use the metadata syntax in dev.cljs.edn:
^{:mode :serve}
{:main following-documentation.core
 :output-dir "target/public/js"
 :output-to "target/public/js/main.js"}
That didn't work either. So the last thing I tried was the inline config when running start: (figwheel.main.api/start {:mode :serve} "dev") And that worked. But that way my :open-url config from figwheel-main.edn doesn't work anymore. So I assume that that inline config makes figwheel-main.edn to be ignored. Is that expected?

damian 2020-07-24T14:07:57.132Z

But again, that inline config isn't my first choice anyway. I'd rather use figwheel-main.edn or dev.cljs.edn for that. In the documentation I found this sentence: > Server only mode is entered when specify `--serve` or `-s` as the only main option to `figwheel.main` I tried removing all config from figwheel-main.edn and leave only {:mode :serve} but that didn't work either.

damian 2020-07-24T14:20:54.132500Z

Oh, pardon me, the metadata config in dev.cljs.edn worked:

^{:mode :serve}
{:main following-documentation.core
 :output-dir "target/public/js"
 :output-to "target/public/js/main.js"}
So that leaves only the figwheel-main.edn that didn't work 😐