/src/leiningen/new/reagent_figwheel/README.md

https://github.com/gadfly361/reagent-figwheel · Markdown · 106 lines · 70 code · 36 blank · 0 comment · 0 complexity · 90770307ea9000e83c02adb35dd8c852 MD5 · raw file

  1. # {{name}}
  2. A [reagent](https://github.com/reagent-project/reagent) application designed to ... well, that part is up to you.
  3. ## Development Mode
  4. {{#devtools?}}### cljs-devtools
  5. To enable:
  6. 1. Open Chrome's DevTools,`Ctrl-Shift-i`
  7. 2. Open "Settings", `F1`
  8. 3. Check "Enable custom formatters" under the "Console" section
  9. 4. close and re-open DevTools
  10. {{/devtools?}}
  11. {{#cider?}}### Start Cider from Emacs:
  12. Put this in your Emacs config file:
  13. ```
  14. (setq cider-cljs-lein-repl "(do (use 'figwheel-sidecar.repl-api) (start-figwheel!) (cljs-repl))")
  15. ```
  16. Navigate to a clojurescript file and start a figwheel REPL with `cider-jack-in-clojurescript` or (`C-c M-J`)
  17. {{/cider?}}
  18. {{#garden?}}### Compile css:
  19. Compile css file once.
  20. ```
  21. lein garden once
  22. ```
  23. Automatically recompile css file on change.
  24. ```
  25. lein garden auto
  26. ```
  27. {{/garden?}}{{#less?}}### Compile css:
  28. Compile css file once.
  29. ```
  30. lein less once
  31. ```
  32. Automatically recompile css file on change.
  33. ```
  34. lein less auto
  35. ```
  36. {{/less?}}
  37. ### Run application:
  38. ```
  39. lein clean
  40. lein figwheel dev
  41. ```
  42. Figwheel will automatically push cljs changes to the browser.
  43. Wait a bit, then browse to [http://localhost:3449](http://localhost:3449).
  44. {{#test?}}### Run tests:
  45. ```
  46. lein clean
  47. lein doo phantom test once
  48. ```
  49. The above command assumes that you have [phantomjs](https://www.npmjs.com/package/phantomjs) installed. However, please note that [doo](https://github.com/bensu/doo) can be configured to run cljs.test in many other JS environments (chrome, ie, safari, opera, slimer, node, rhino, or nashorn).
  50. {{/test?}}
  51. {{#devcards?}}### Devcards
  52. ```
  53. lein clean
  54. lein figwheel devcards
  55. ```
  56. Figwheel will automatically push cljs changes to the browser.
  57. Wait a bit, then browse to [http://localhost:3449/cards.html](http://localhost:3449/cards.html).
  58. ---
  59. To build a minified version:
  60. ```
  61. lein clean
  62. lein cljsbuild once hostedcards
  63. ```
  64. Then open *resources/public/cards.html*
  65. {{/devcards?}}
  66. ## Production Build
  67. ```
  68. lein clean
  69. lein cljsbuild once min
  70. ```