{:deps {:aliases [:dev]}
 :http {:port 3448}
 :nrepl {:port 3447 :host "0.0.0.0"}
 :dev-http {8888 "classpath:public"}

 :builds
 {:main
  {:target :browser
   :output-dir "resources/public/js/"
   :asset-path "/js"
   :devtools {:browser-inject :main
              :watch-dir "resources/public"
              :reload-strategy :full}
   :build-options {:manifest-name "manifest.json"}

   :modules
   {:shared {:entries []}

    :main
    {:entries [app.main]
     :depends-on #{:shared}
     :init-fn app.main/init}

    :render
    {:entries [app.render]
     :depends-on #{:shared}
     :init-fn app.render/init}

    :worker
    {:entries [app.worker]
     :web-worker true
     :depends-on #{:shared}}

    :rasterizer
    {:entries [app.rasterizer]
     :depends-on #{:shared}
     :init-fn app.rasterizer/init}}

   :compiler-options
   {:output-feature-set :es2020
    :output-wrapper false
    :warnings {:fn-deprecated false}}

   :release
   {:closure-defines {goog.DEBUG false
                      goog.debug.LOGGING_ENABLED true}
    :compiler-options
    {:fn-invoke-direct true
     :optimizations #shadow/env ["PENPOT_BUILD_OPTIMIZATIONS" :as :keyword :default :advanced]
     :source-map true
     :elide-asserts true
     :anon-fn-naming-policy :off
     :source-map-detail-level :all}}}

  :storybook
  {:target :esm
   :output-dir "target/storybook/"
   :modules
   {:design-system {:exports {default app.main.ui.components.design-system/default} }}

   :js-options
   {:js-provider :import}

   :compiler-options
   {:output-feature-set :es2020
    :output-wrapper false
    :warnings {:fn-deprecated false}}}

  :lib-penpot
   {:target :esm
    :output-dir "resources/public/libs"

   :modules
   {:penpot {:exports {:renderPage app.libs.render/render-page-export
                       :createFile app.libs.file-builder/create-file-export}}}

   :compiler-options
   {:output-feature-set :es2020
    :output-wrapper false
    :warnings {:fn-deprecated false}}

   :release
   {:compiler-options
    {:fn-invoke-direct true
     :source-map true
     :elide-asserts true
     :anon-fn-naming-policy :off
     :source-map-detail-level :all}}}

  :bench
  {:target :node-script
   :output-to "target/bench.js"
   :output-dir "target/bench/"
   :main bench/main

   :compiler-options
   {:output-feature-set :es2020
    :output-wrapper false
    :warnings {:fn-deprecated false}}

   :release
   {:compiler-options
    {:fn-invoke-direct true
     :elide-asserts true
     :anon-fn-naming-policy :off}}}

  :test
  {:target :node-test
   :output-to "target/tests.js"
   :output-dir "target/test/"
   :ns-regexp "^frontend-tests.*-test$"
   :autorun true

   :compiler-options
   {:output-feature-set :es2020
    :output-wrapper false
    :source-map true
    :source-map-include-sources-content true
    :source-map-detail-level :all
    :warnings {:fn-deprecated false}}}

  }}

