I'm running `wasmJsBrowserDistribution` to package...
# compose-web
a
I'm running
wasmJsBrowserDistribution
to package my compose web wasm app but the distribution contains 2 wasm files with weird names. is that normal? I expected to have just one .wasm file with the name is specify in the distribution block
the output dir looks like this:
Copy code
50c72294d780222b8feb.wasm
bccfa839aa4b38489c76.wasm
composeApp.js
index.html
r
I think one is your application and the other is skiko runtime (it should have about 8MB size)
2
a
indeed. but this is problematic, because I need to manually put 'preload' on the index.html after the app has been generated. ideally I want to just add the preload line once in the index.html resource
o
@Ilya Goncharov [JB] do I remember correctly that it's renamed by webpack? Can we affect it?
m
o
I see. I was Out of Office for the previous 2 months and saw your report just now. > I therefore propose to either drop this feature and switch back to fixed names or introduce some configuration option to override this behavior. The described behaviour is not a part of CMP. It makes sense to follow https://youtrack.jetbrains.com/issue/KT-73908
👀 1
a
+1'd and added my use case
t
@Alex Styl https://github.com/Taz03/matrix-calculator/blob/main/scripts/build.sh i wrote this script to change those names to always be composeApp.wasm and skiko.wasm and the preload those in html
im using production webpack gradle task here wasn't aware of distribution task will look into it
a
I saw your script (was interested in the optimizations you did). the task u use
wasmJsBrowserProductionWebpack
always create the files with a more human readable names I noticed but it doesn't work with the specified output path. I ended up using
wasmJsBrowserDistribution
and then appending the .wasm files manually using a script into the
index.html
instead.
t
> wasmJsBrowserProductionWebpack always create the files with a more human readable names I noticed but it doesn't work with the specified output path wdym? the file names are actually the same in both commands, distribution just packages them in a folder which i did manually with
cp
. The script would still work just need to change the path
a
from my tests I noticed that
wasmJsBrowserProductionWebpack
outputs wasm files as 'skiko.wasm' and 'composeApp.wasm'. output directory cannot be specified
wasmJsBrowserDistribution
outputs wasm files as random numbers .wasm. output directory is specified by the distribution block
t
wasmJsBrowserProductionWebpack
outputs wasm files as 'skiko.wasm' and 'composeApp.wasm'. output directory cannot be specified
it does in some sub folder yes, but the glue js still has both in random letters form which is the real problem i had to solve with the script
so you'll need to use productionwebpack and cp the files manually
a
indeed. that's why i went with the distribution task instead and modified the final .html file instead finding it simpler to write code to modify one file instead of multiple, but it's only a matter of preference
👍 1