Fork me on GitHub
#shadow-cljs
<
2022-06-27
>
thheller06:06:36

babel is sometimes used when compiling node_modules esm code

ccann18:06:59

apologies if this is a very stupid question… I have added :module-hash-names true and understand the contents of manifest.edn but where / how can I go about specifying the correct file name in index.html (the script src)?

thheller18:06:30

do you have an actual static index.html? most setups use some sort of server to generate html?

ccann18:06:03

it’s a single page app, so I have a static index.html

thheller18:06:33

basically just copies the first argument to the second argument location

ccann18:06:45

Maybe I’m doing something incorrectly here:

:target            :browser
   :compiler-options  {:externs ["resources/lib/ext/oidc-client-ts.ext.js"]}
   :module-hash-names true
   :output-dir        "resources/public/js"
   :asset-path        "/js"
   :build-hooks       [(shadow.html/copy-file
                        "resources/index.src.html"
                        "resources/public/index.html")]
   :modules           {:main {:init-fn co.flair.fleet.core/init}}
I put my static index file in resources/index.src.html and it has the tag <script src="/js/app.js"></script> but when I run shadow-cljs release app it copies the index file to resources/public/index.html but it doesn’t rewrite the script tag

thheller18:06:14

you have :modules {:main so the src should be /js/main.js

ccann18:06:30

sorry about that facepalm thanks very much for the help

thheller18:06:38

while also rewriting script tags