shadow-cljs.edn 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. ;; shadow-cljs configuration
  2. {:deps true
  3. :nrepl {:port 8701}
  4. :builds
  5. {:app
  6. {:target :browser
  7. :module-loader true
  8. ;; handle `require(xxx.css)`
  9. :js-options {:ignore-asset-requires true}
  10. :modules {:main {:init-fn frontend.core/init}
  11. ;; :graph
  12. ;; {:entries [frontend.extensions.graph.force]
  13. ;; :depends-on #{:main}}
  14. :code-editor
  15. {:entries [frontend.extensions.code]
  16. :depends-on #{:main}}
  17. :age-encryption
  18. {:entries [frontend.extensions.age-encryption]
  19. :depends-on #{:main}}
  20. :excalidraw
  21. {:entries [frontend.extensions.excalidraw]
  22. :depends-on #{:main}}}
  23. :output-dir "./static/js"
  24. :asset-path "/static/js"
  25. :release {:asset-path "https://asset.logseq.com/static/js"}
  26. :compiler-options {:infer-externs :auto
  27. :output-feature-set :es-next-in
  28. :source-map true
  29. :optimizations :simple
  30. :externs ["datascript/externs.js"
  31. "externs.js"]
  32. :warnings {:fn-deprecated false}
  33. ;; For debug
  34. ;; :pseudo-names true
  35. }
  36. :closure-defines {goog.debug.LOGGING_ENABLED true
  37. frontend.config/GITHUB_APP_NAME #shadow/env "GITHUB_APP2_NAME"}
  38. :devtools
  39. ;; before live-reloading any code call this function
  40. {:before-load frontend.core/stop
  41. ;; after live-reloading finishes call this function
  42. :after-load frontend.core/start
  43. :http-root "public"
  44. :http-port 3001
  45. :watch-path "static"
  46. :preloads [devtools.preload
  47. shadow.remote.runtime.cljs.browser]}}
  48. :electron {:target :node-script
  49. :output-to "static/electron.js"
  50. :main electron.core/main
  51. :devtools
  52. {:before-load electron.core/stop
  53. :after-load electron.core/start}
  54. :compiler-options
  55. {:infer-externs :auto
  56. :source-map true
  57. :source-map-include-sources-content true
  58. :source-map-detail-level :all
  59. :externs ["datascript/externs.js"
  60. "externs.js"]
  61. :warnings {:fn-deprecated false}}}
  62. :parser-worker
  63. {:target :browser
  64. :output-dir "./static/js"
  65. :asset-path "./js"
  66. :compiler-options {:source-map false
  67. :source-map-include-sources-content false}
  68. :modules {:parser-worker {:entries [frontend.worker.parser]
  69. :web-worker true
  70. :prepend #shadow/env ["PATCH_PARSER_WORKER" :default ";;"]
  71. }}
  72. :release {:compiler-options {:infer-externs :auto}}}
  73. :test
  74. {:target :node-test
  75. :output-to "static/tests.js"
  76. :closure-defines {frontend.util/NODETEST true}
  77. :devtools {:enabled false}}
  78. :publishing
  79. {:target :browser
  80. :module-loader true
  81. :js-options {:ignore-asset-requires true}
  82. :modules {:main {:init-fn frontend.publishing/init}
  83. ;; :graph
  84. ;; {:entries [frontend.extensions.graph.force]
  85. ;; :depends-on #{:main}}
  86. :code-editor
  87. {:entries [frontend.extensions.code]
  88. :depends-on #{:main}}
  89. :age-encryption
  90. {:entries [frontend.extensions.age-encryption]
  91. :depends-on #{:main}}
  92. :excalidraw
  93. {:entries [frontend.extensions.excalidraw]
  94. :depends-on #{:main}}}
  95. :output-dir "./static/js/publishing"
  96. :asset-path "static/js"
  97. :closure-defines {frontend.config/PUBLISHING true
  98. goog.debug.LOGGING_ENABLED true}
  99. :compiler-options {:infer-externs :auto
  100. :output-feature-set :es-next
  101. :externs ["datascript/externs.js"
  102. "externs.js"]
  103. :warnings {:fn-deprecated false}}
  104. :devtools
  105. ;; before live-reloading any code call this function
  106. {:before-load frontend.core/stop
  107. ;; after live-reloading finishes call this function
  108. :after-load frontend.core/start
  109. :preloads [devtools.preload]}}
  110. :cards {:target nubank.workspaces.shadow-cljs.target
  111. :ns-regexp "(test|cards)$"
  112. :output-dir "./static/js/workspaces"
  113. :asset-path "/static/js/workspaces"
  114. :preloads [] ; optional, list namespaces to be pre loaded
  115. :devtools
  116. {
  117. :after-load nubank.workspaces.core/after-load
  118. :loader-mode :eval
  119. :http-root "public/workspaces"
  120. :http-port 3002
  121. :watch-path "static"
  122. :preloads [devtools.preload
  123. shadow.remote.runtime.cljs.browser]}
  124. :modules {:main {:entries [workspaces.main]}}}}}