Pavel Janečka
01/23/2021, 10:13 AMcommonMain
for the js
target
js(LEGACY) {
browser {
binaries.executable()
webpackTask {
cssSupport.enabled = true
}
}
}
and if I run the `jsBrowserDevelopmentRun`task (in project root) the started webpack-dev-server serves from
<project-root>/mainModule/build/processedResources/js/main/
path, but the actual build is located at
<project-root>/build/js/packages/<project-name>-mainModule/kotlin-dce-dev/<project-name>-mainModule.js
how can I get to the build fil in my index.html
then (located in <project-root>/mainModule/src/jsMain/resources/index.html
)?
Even if I hardcode relative path to the build file, the dev server won't serve it (I guess it's forbidden to go up from serve path - for security reasons - by default).Pavel Janečka
01/23/2021, 10:54 AM<script src="mainModule.js"></script>
in my HTML. Can someone explain me why is that?turansky
01/23/2021, 1:01 PMproper way is to putAnd what was before? Html file without script?in my HTML. Can someone explain me why is that?<script src="mainModule.js"></script>
Pavel Janečka
01/23/2021, 1:23 PMturansky
01/23/2021, 10:51 PMbuild
you can check build/distributions
folder. It will contains file with “webpack” nameturansky
01/23/2021, 10:54 PMmoduleName
in js
block to sync “Kotlin” and “Webpack” namesPavel Janečka
01/24/2021, 3:33 PMoutputFileName
in commonWebpackConfig
instead of `webpackTask`like this
kotlin {
js(LEGACY) {
browser {
binaries.executable()
webpackTask {
cssSupport.enabled = true
}
commonWebpackConfig {
outputFileName = "<my-selected-name>.js"
}
}
}
}
Thanks for the help! 👍Cheick Kante
12/15/2022, 9:16 PM