Also, looking at the doodle examples, I noticed th...
# doodle
a
Also, looking at the doodle examples, I noticed there's a separate module for the application code and the application launch code. Is there a reason for this?
n
The examples use a different module for the runners simply because of a limitation where you can only have a single
main
in a JS module. The examples have a main for the docs app, which depends on the apps. so this won’t work if the apps have their own main. So I split the apps into a library without their launch part so the docs can depend on these. Then the standalone app uses a different module to launch and the docs module launches each app from its lib.
1
a
So I would only need to have a separate launch module if I wanted the JS module to be accessible from other sources? So if I wanted the just desktop platform to be a library, for example, I could put it all in one module?
n
yep. i have a project that targets JS, WASMJS, and Desktop and it has the following modules:
Copy code
Shared
- commonMain // common application code
Web
- jsCommon   // common code for web
- jsMain     // launch code for JS
- wasmJsMain // launch code for WASM 
Desktop
- main       // launch code for Desktop
🎉 1