Daniel Weidensdörfer
10/25/2024, 12:43 PM<i> [webpack-dev-middleware] wait until bundle finished: /
webpack 5.93.0 compiled successfully in 147885 msDaniel Weidensdörfer
10/25/2024, 2:00 PMbuild.gradle there is the following configuration to add sources to webpack for debugging in browser:
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
...
browser {
val rootDirPath = project.rootDir.path
val projectDirPath = project.projectDir.path
commonWebpackConfig {
outputFileName = "composeApp.js"
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
static = (static ?: mutableListOf()).apply {
// Serve sources to debug inside browser
add(rootDirPath)
add(projectDirPath)
}
}
}
}
...
}
Previously only the projectDirPath has been added and webpack bundeling took around 7 seconds for me. Now, if you create a new project using the kmp wizard, rootDirPath is added as well, which causes the bundling time to go up to 2 minutes.
I'm sure there is a reason for adding rootDirPath for debugging as well, but compile + 2 minutes bundeling is not acceptable. Not adding any files to webpack makes the webpage show up immediatelly.