hi everyone, im getting into kotlin with javascrip...
# javascript
h
hi everyone, im getting into kotlin with javascript, and im getting an error while creating a basic file: im not sure what the issue is though. im using gradle with the build tool ‘assembleWeb’ which comes from the https://kotlinlang.org/docs/tutorials/javascript/getting-started-gradle/getting-started-with-gradle.html example on the website, so im a bit confused what’s wrong
g
What does your build.gradle looks like?
h
https://ghostbin.com/paste/72dvb, i am running
gradle assembleWeb
g
Replace "amd" with "umd"
h
ok
what does that change and mean?
btw, it worked. 🙂
g
It changes module definition, so it can work both on client and server. https://kotlinlang.org/docs/tutorials/javascript/working-with-modules/working-with-modules.html I have struggled with this too and I have ended up with completely different build file, just to get tests working
h
so if i understand correctly, the kotlin.js file is created for nodejs, and so when i tried using that with my file, which was for the browser, it didn’t work?
or was it the other way round
g
h
yeah, i read the difference, but i don’t exactly understand the main differences between commonjs and AMD
n
One of the major differences is that commonjs is the module standard used by Node, and amd modules aren't Node compatible. The umd module standard creates a module that is compatible with commonjs and amd.