Ryan Malaspina
11/03/2023, 6:02 PMwhole-program
or per-module
.
Not all of these files need to stay as separate files, but there's enough I want to keep as separate files that making a module for each one would not be ideal. All of the files are pretty small but import an external typescript library which I can make external declarations for. The ones I want to keep as separate files each export a 'main' function with the same signature and each javascript file could get loaded and called dynamically by the external library.
I did some experimenting with the command line compiler and got some basic Kotlin files compiled to javascript, but I'm not sure how to manage imports from other files and share the Kotlin js stdlib between them allEdoardo Luppi
11/04/2023, 7:46 PMper-file
is a valid granularity when targeting ES modules.
However the per file support is still in early stage AFAIK, so you might encounter issues.
Also, multiple main
functions (e.g., one per file) are currently unsupported (I've seen a commit fixing this but not sure if it was backported).Ryan Malaspina
11/07/2023, 5:33 PM