dwursteisen
04/15/2023, 2:09 PMmyProject
) using IntelliJ wizard and I added a npm dependency.
When running the gradle task browserDevelopmentRun
, the webpage is working.
I can use the dependency. Everything is working as expected 👍
But if, instead of having everything in the root module of my project, I moving everything in another module of my gradle project (ie: myProject/myJsApp
), the content of my JS file used by the browser when using the task myJsApp:browserDevelopmentRun
is different.
When it’s working, the javascript generated file start with an UMD definition (webpackUniversalModuleDefinition
) while when it’s not working, it’s another code, which, I believe, is trying to use a loader system. My though is that in the first case, the creation of the Javascript application is working as expected while is the second case, it’s like a javascript lib that is created (but I configured *binaries*.executable()
). I check the documentation, this slack, and also the Kotlin Youtrack without finding something about that. Is that a limitation of Kotlin/JS or is it expected?
Thanks 🙂Mike Dawson
04/16/2023, 8:33 AMdwursteisen
04/16/2023, 3:54 PMsubmodule
. In my index.html, I using the javascript file myProject-submodule.js
That’s the mistake. Even if the file exist, it’s not the one I need to use.
I spend a bit of time reading the webpack documentation. In the webpack.config.js
, the name of the bundle is submodule.js
So using submodule.js
instead of `myProject-submdule.js`fix the issue. 😬
I got a bit fooled because I didn’t saw submodule.js
on my disk.turansky
04/16/2023, 4:29 PMmoduleName
property in configuration to have constant file name