shadow-cljs.edn 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. :externs ["datascript/externs.js"
  30. "externs.js"]
  31. :warnings {:fn-deprecated false}}
  32. :closure-defines {goog.debug.LOGGING_ENABLED true
  33. frontend.config/GITHUB_APP_NAME #shadow/env "GITHUB_APP2_NAME"}
  34. :devtools
  35. ;; before live-reloading any code call this function
  36. {:before-load frontend.core/stop
  37. ;; after live-reloading finishes call this function
  38. :after-load frontend.core/start
  39. :http-root "public"
  40. :http-port 3001
  41. :watch-path "static"
  42. :preloads [devtools.preload
  43. shadow.remote.runtime.cljs.browser]}}
  44. :electron {:target :node-script
  45. :output-to "static/electron.js"
  46. :main electron.core/main
  47. :devtools
  48. {:before-load electron.core/stop
  49. :after-load electron.core/start}
  50. :compiler-options
  51. {:infer-externs :auto
  52. :source-map true
  53. :source-map-include-sources-content true
  54. :source-map-detail-level :all
  55. :externs ["datascript/externs.js"
  56. "externs.js"]
  57. :warnings {:fn-deprecated false}}}
  58. :parser-worker
  59. {:target :browser
  60. :output-dir "./static/js"
  61. :asset-path "./js"
  62. :compiler-options {:source-map false
  63. :source-map-include-sources-content false}
  64. :modules {:parser-worker {:entries [frontend.worker.parser]
  65. :web-worker true
  66. :prepend #shadow/env ["PATCH_PARSER_WORKER" :default ";;"]
  67. }}
  68. :release {:compiler-options {:infer-externs :auto}}}
  69. :test
  70. {:target :node-test
  71. :output-to "static/tests.js"
  72. :closure-defines {frontend.util/NODETEST true}
  73. :devtools {:enabled false}}
  74. :publishing
  75. {:target :browser
  76. :module-loader true
  77. :js-options {:ignore-asset-requires true}
  78. :modules {:main {:init-fn frontend.publishing/init}
  79. ;; :graph
  80. ;; {:entries [frontend.extensions.graph.force]
  81. ;; :depends-on #{:main}}
  82. :code-editor
  83. {:entries [frontend.extensions.code]
  84. :depends-on #{:main}}
  85. :age-encryption
  86. {:entries [frontend.extensions.age-encryption]
  87. :depends-on #{:main}}
  88. :excalidraw
  89. {:entries [frontend.extensions.excalidraw]
  90. :depends-on #{:main}}}
  91. :output-dir "./static/js/publishing"
  92. :asset-path "static/js"
  93. :closure-defines {frontend.config/PUBLISHING true
  94. goog.debug.LOGGING_ENABLED true}
  95. :compiler-options {:infer-externs :auto
  96. :output-feature-set :es-next
  97. :externs ["datascript/externs.js"
  98. "externs.js"]
  99. :warnings {:fn-deprecated false}}
  100. :devtools
  101. ;; before live-reloading any code call this function
  102. {:before-load frontend.core/stop
  103. ;; after live-reloading finishes call this function
  104. :after-load frontend.core/start
  105. :preloads [devtools.preload]}}
  106. :cards {:target nubank.workspaces.shadow-cljs.target
  107. :ns-regexp "(test|cards)$"
  108. :output-dir "./static/js/workspaces"
  109. :asset-path "/static/js/workspaces"
  110. :preloads [] ; optional, list namespaces to be pre loaded
  111. :devtools
  112. {
  113. :after-load nubank.workspaces.core/after-load
  114. :loader-mode :eval
  115. :http-root "public/workspaces"
  116. :http-port 3002
  117. :watch-path "static"
  118. :preloads [devtools.preload
  119. shadow.remote.runtime.cljs.browser]}
  120. :modules {:main {:entries [workspaces.main]}}}}}