@ JSExport and webpack in dev mode are exporting m...
# javascript
r
@ JSExport and webpack in dev mode are exporting my bundle in slightly different namespaces - is this a known issue / is there a workaround? (details in thread)
the entrypoint to my bundle is :
Copy code
package rcp.view

...
@OptIn(ExperimentalJsExport::class)
@JsExport
class Recipe {
when I compile the bundle, I have to initialize it (from html) as:
Copy code
recipe.rcp.view.Recipe();
when running via webpack, the "recipe" namespace is changed to "rcp", so this becomes:
Copy code
rcp.rcp.view.Recipe();
i don't even understand why there's anything prefixing the package - can i get rid of that somehow?
t
anything prefixing the package
In UMD - it's your library name
r
@turansky where is this specified in the project?
(and is it a bug that it differs based on compiled vs webpack? i can file)
t
where is this specified in the project?
AFAIK In webpack task
r
hm, I can't seem to get rid of the namespace, but specifying:
Copy code
webpackTask {
    output.libraryTarget = "umd2"
}
at least makes the namespace consistent. whatever the default is seems to differ