Hi <@UFGCACPE0>. I'm testing your vite plugin and ...
# opensavvy
r
Hi @CLOVIS. I'm testing your vite plugin and I'm not sure why the reload process is slow (slower than with webpack).
🤔 1
1
When I make a change in the code, the
viteCompileDev
task rebuilds the app. I think this part works correctly. But then the
viteRun
task reloads the page and it lasts a few secods. There are lot of lines like this printed:
Copy code
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/Debug.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/CoroutineExceptionHandler.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/JSDispatcher.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/SchedulerTask.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/CompletionState.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/Builders.common.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/Supervisor.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/Job.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/EventLoop.common.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/Dispatchers.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/Delay.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/flow/SharedFlow.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/flow/Channels.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/flow/FlowCollector.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/flow/Limit.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/flow/Collect.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/flow/Flow.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/flow/internal/FlowExceptions.mjs
17:21:31 [vite] (client) page reload kotlinx-coroutines-core/kotlinx/coroutines/flow/internal/FlowExceptions.common.mjs
In my case it prints files from all libraries I use (coroutines, compose, stdlib and finally my own libs). A lot of files.
Is this the expected behavior?
There is no single bundle. The browser loads all these scripts separately. There are over 400 separate http requests. It takes a lot of time to process them and render results.
I'm using "per-file" granularity. Is my issue related to https://gitlab.com/opensavvy/automation/kotlin-vite/-/issues/61 ?
It works a lot faster when I remove per-file granularity. Still there is no single bundle but now there are only 13 js files to process
Library files are loaded with some random/timestamp parameters:
Zrzut ekranu z 2025-08-24 18-10-41.png
It would probably work better if the files could be cached.
c
There is no single bundle. The browser loads all these scripts separately.
To my knowledge, this is the expected behavior, and the initial idea behind Vite in the first place: since the browser understands ESM, why not just give all the files to the browser directly and not really have any middleman at all? In theory it shouldn't be possible to be faster than this. However I think there may be something wrong if it's reloading files that haven't changed… If the repo you're testing it on is public, that would help a lot!
I haven't had the occasion to try per-file granularity yet. It's in my backlog, but I don't know exactly what it will entail yet.
There may be something that can be done by configuring the watcher. I created an issue, please add any reproducer you may have (minimal or not) there.
@Robert Jaros Do you have experience with the configuration cache? I'm having difficulties with this job, from the branch
es2015
, I don't understand what's going wrong. Even a workaround would help me a lot.
Goods news, I managed to fix the multi-reload problem. There's more info in the issue & MR if you're curious. It should land in a few days.
👍 1
r
> Do you have experience with the configuration cache? I'm having difficulties with this job, from the branch es2015 , I don't understand what's going wrong. Don't really. I would guess there are some problems deserializing
KotlinPackageJsonTask
task because of
KotlinNpmResolutionManager
property. Maybe because the resolutions (npm pacakges) are now conditionally applied.
c
Fixed in 0.6.1
👍 1