Fork me on GitHub
#shadow-cljs
<
2021-09-06
>
kirill.salykin11:09:12

hi is there a way to get output name with hash in the build hook (`on-flush` stage)?

(get-in build-state [:shadow.build.modules/modules module-id :output-name])
returns name w/o hash

thheller11:09:49

@kirill.salykin :shadow.build.closure/modules should have the hashes in :output-name

kirill.salykin11:09:01

super! thanks you

thheller11:09:28

there is a bit of duplication. shadow.build.modules is before optimizations and shadow.build.closure is after

Ryan Jerue14:09:23

Does something like https://www.npmjs.com/package/webpack-bundle-analyzer exist for things built on shadow using :target :node-library ?

mkvlr14:09:28

does shadow also support pure js “modules”. Or would setting :prepend-js with a an empty module ns have the same effect?

borkdude14:09:40

what is a pure js module? (just being curious, instead of helpful)

thheller14:09:32

yeah whats a pure js module? you mean only js sources? you can define :modules {:js-only {:entries ["/that/file.js"]}}

mkvlr14:09:55

yes, @U05224H0W that’s that I meant, thanks!

thheller14:09:06

I doubt anyone has ever done this though. not actually sure it works. should in theory though

mkvlr14:09:21

ok, will try & report back 😼

mkvlr14:09:01

ok, so works somewhat, ie it produces a file I can load, the downside is that it still bundles the whole cljs runtime so still produces a ~5mb js in dev even though I’m just loading a smallish npm lib

thheller14:09:31

if you set :devtools {:enabled false} that shouldn't happen

thheller14:09:39

maybe :console-support false also (also in :devtools)

thheller15:09:24

I specifically set it up to not include cljs.core if there are no sources requiring it. for watch the injected REPL/hot-reload code will however bring it in unless disabled

mkvlr15:09:53

cool, that works, thanks!

👍 2