I am just trying to do a simple proof of concept t...
# javascript
a
I am just trying to do a simple proof of concept to create a javascript library from a kotlin MP project. Creating a new MP project and building produces a build/distributions/MyProject.js file, I copy and include this in an html <script> and able to do console.log(MyProject) but not sure if its working or how to use it beyond that. I tried the things suggested like "@JsName" or including the package name. For example the default project it creates has a class "Sample" and object "Platform" with package "sample". In Javascript things like MyProject.sample or .Sample or .Platform are all undefined. Inspecting the object does not appear to have anything I recognize either. Using MP 1.3.72 if that matters.
I tried this on another project that did something with the document in main() which worked. It looks like the javascript is only generated for code that's used. Since this is for a library I don't need main() and most of the code is classes/functions that are never called except outside the project. Is there a setting to fix this?
Setting the dcetask in build.gradle might be a fix for this but seems very unintuitive as a solution for a common setup.
d