markaren / three-kt-wrapper

Kotlin wrappers for Three.js

Home Page:https://markaren.github.io/three-kt-wrapper/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use UMD Modules

ScottPeterJohnson opened this issue · comments

Currently the wrapper generates a "plain" JS module library, which doesn't play well with webpack. The kotlin standard lib and kotlinx-html both use UMD, which might be a safer choice.
Really this just requires adding
compileKotlin2Js { kotlinOptions.moduleKind = "umd" }
to build.gradle. I could make a pull request if desired.

I'm only a hobby JS user, so I have no experience with JS package managers.
After adding this, do I have to make changes to how I load JS in i.e. https://github.com/markaren/three.kt/blob/master/example/web/hello_world.html ?

You shouldn't have to. In a non-module environment, it should fall back to plain.

Then I'm happy to accept your PR. Target the dev branch

Applied through pull request #11
Included in release ALPHA-5