Closed kolotyluk closed 1 year ago
Hello,
Yes, main.bundle.js
is a JS file created by webpack by bundling Kotlin code compiled to JavaScript and all NPM dependencies of the project.
When building your app in production mode (./gradlew browserProductionWebpack
) this file will be generated in the build/distributions
directory.
When using development mode (./gradlew -t run
) the file is created dynamically and served by the webpack dev server. You won't find it on the file system, but you can download it from http://localhost:3000/main.bundle.js when the dev server is running.
Interestingly, I did try looking at main.bundle.js
indirectly by viewing the page source at http://localhost:3000
and clicking the link for main.bundle.js
, but it resulted in a blank page. Pasting http://localhost:3000/main.bundle.js
directly into Firefox does show the file. The enduring mysteries of web browsers... Anyway, I would be happy to add some documentation for this if you can point me to where the plugin generates build.gradle.kts
, or there may be better places to document this important information.
Thanks for confirming what I suspected.
So far I am impressed with the overall quality and completeness of this project. Good job.
I have tried playing with Scala/JS, but it is not as high quality or completeness.
Great work! :-) I've found one inaccuracy - currently Kotlin/JS (and KVision) is compiled to pure JavaScript and there is no WASM in the bundle. WASM target in the Kotlin compiler is a new, experimental feature and I plan to work to support WASM target in KVision in the near future.
Thanks... updated the article.
I created my first project via the IntelliJ plugin... pretty good, but I need to figure out where to give feedback...
While I was inspecting the project, I can see the file
index.html
containsThis begs the question: where is
main.bundle.js
?Mysteries like this are disturbing because it should be easier to reverse-engineer code...
I am guessing this file resides in the
webpack
server somewhere because I cannot find it anywhere in the file system.It would be beneficial, in terms of learning, if it were easier to understand what is going on here, and see the contents of
main.bundle.js
.I am guessing this might be the Kotlin program complied to JavaScript, but I am only guessing.