When generating Javascript binaries in dist/js fol...
# javascript
p
When generating Javascript binaries in dist/js folder i see *.mjs files that are never used/downloaded when browsing app. Why are they needed? Is it safe to remove them from distribution? Kotlin 2.2.20-Beta2 Compose 1.9.0-rc01
a
@Ilya Goncharov [JB], is it true that the
dist
directory contains the files after webpack procesing?
i
dist
directory shod contain webpack output and all resources
a
And do we copy ourselves something to the directory?
Because it's quite weird that
mjs
files appear in the directory, if webpack generates
js
i
We can copy resources IIRC, and we copy webpack output there
p
I see these files in dist/js/productionExecutable:
Copy code
7c00bf3a63531ae384d9.wasm
731.js
731.js.map
js-reexport-symbols.mjs
app.js
app.js.LICENSE.txt
app.js.map
skiko.mjs
skiko.wasm
skikod8.mjs
a
And do you have something like
reexport-symbols
module?
p
No
Also i don't know what is 731. It is not used when browsing.
a
I believe it could be some async chunk to load, but I'm not sure. I need to inspect the code to understand the purpose of the each chunk generated by webpack
1
p
If needed more info for reproduce, please ask. I'm declaring
Copy code
browser{useEsModules()}
just in case it may help
e
731 is a chunk produced by Webpack.
As far as I recall, the WASM part of Kotlin always operates under ESM mode. So maybe that's why the skiko JS wrapper is generated with the .mjs extension.
p
skiko.wasm also is not used. 7c00bf3a63531ae384d9.wasm is used instead (it is the copy of skiko.wasm but with unique name) May be it should also be filtered out.