I am compiling some modules from kotlin to javascript but using the in javascript looks a bit ugly since I have to go into the whole scope of the organization domain to get the necessary class
Is there any solution please? I always have to use
let package= require("packageName").com.company.package.ClassName
I would like to set the package name in order to access directly to the class eg:
Simply, in your Kotlin module, move all your files to the top level src/kotlin folder, instead of being in src/kotlin/com/company/package, and also remove the package com.company.package at the top of each file.
I have exactly the same problem. My kotlin code is both used from the JVM and the browser, so I need to maintain a package hierarchy for my classes and use a package name that is consistant with my JVM code base (let’s say com.example.myproject). As this is fine for the JVM, it is really ugly to have this prefix in my JavaScript code.
I would expect a JsPackageName annotation or any other mechanism to customize the name of the generated JS package.
Isn’t there an existing solution?