1.0.7 • Published 6 years ago
@sergeylarionov/now-shadow-cljs v1.0.7
now-shadow-cljs
A ▲ Now 2.0 builder for ClojureScript projects using shadow-clj. The builder will build your shadow-cljs targets and deploy them to ▲ Now.
Usage
- Create a shadow-cljs project. This builder supports building - :browserand- :node-librarytargets. If the target is- :browserit will be deployed as a static page and if it is- :node-libraryit will be deployed as a lambda function.
- Write a - now.jsonfile that uses- @jntn/now-shadow-cljs. Note: If you do not specify a- routessection, the build output will be available under the specified output folder. For- :node-libraryit is the- :output-topath and for- :browserit is the- :output-dirpath.
For an example using both browser and node builds, see github.com/jntn/haiku
Example now.json
{
    "version": 2,
    "name": "haiku",
    "builds": [
        {
            "src": "shadow-cljs.edn",
            "use": "@jntn/now-shadow-cljs"
        }
    ],
    "routes": [
        {
            "src": "/(.*)",
            "dest": "/public/$1"
        },
        {
            "src": "/api/(.*)",
            "dest": "/api/$1"
        }
    ]
}Example shadow-cljs.edn
{:builds {:haikus {:target :node-library
                   ;; Will be available at "/api/haikus"
                   :output-to "api/haikus/index.js"
                   :exports-var jntn.api.haikus/handler}
          :app {:target :browser
                ;; Will by default be available at "/public" but
                ;; using the now.json above it is reached at "/"
                :output-dir "public/js"
                :asset-path "js"
                :modules {:main {:entries [jntn.app.core]}}
                :devtools {:http-root "public"
                           :proxy-url "http://localhost:3000"
                           :http-port 8000}}}}Caveats
- Right now the only supported build targets are :browserand:node-library.
- The builder does not currently work with :deps trueinshadow-cljs.edn.