So I have a small problem with the old `kotlin2js`...
# javascript
f
So I have a small problem with the old
kotlin2js
plugin I was able to set the output Javascript filename with the following snippet in my
build.gradle.kts
:
setProperty("archivesBaseName", "main")
but in the new js plugin this just renames the single file in
distributions
but not the output in the DCE output directory. There the main source code file is still called
${rootProject.name}-${project.name}.js
is there any way to have the file that is placed in the DCE output folder to be called
main.js
instead?
t
Why do you need
main.js
filename in DCE folder?
f
I guess I don't just found that I can just rename it in my CopyTask. Its for a game where you need the JS file to be called
main.js
t
Looks like file in
distributions
dir is what you need Since Kotlin
1.3.70
DCE results used for distribution by default
f
but in distributions its all in a single file even if I enable commonJS (it does not contain a separate kotlin.js file)
t
Rule patch can resolve this problem
Copy code
// webpack.config.d/rules.js
config.externals = [
  /^kotlin$/i,
]
Only
kotlin
must be external?