Small update on Vite: many bugs have been fixed, i...
# opensavvy
c
Small update on Vite: many bugs have been fixed, it now works with Gradle 9, and there's a prototype WasmJS support (thanks to @Robert Jaros) However, in the process of all of that, there's a regression in CommonJS mode (the default). ES2015 mode is not affected and works correctly. Should I release anyway? Or wait for the fix?
please wait 1
r
I see the fix is already in the MR.
c
No, it doesn't work 😕 It fixes it at development time, but it's still broken in the production build → https://opensavvy.gitlab.io/-/automation/kotlin-vite/-/jobs/12348530876/artifacts/kotlin-example/index.html
😭 1
r
You can consider using vite-rolldown instead of original vite. I've made some tests and it seems to work fine with kotlin-vite. With vite-rolldown you don't need
@rollup/plugin-commonjs
and
vite-plugin-top-level-await
anymore. And with one additional config option
moduleTypes: {'.mjs': 'js'}
it correctly builds dev and prod versions for both your examples and my JS/WasmJS project. Rolldown performance we get for free 🙂
👀 1
c
Interesting. I guess we could have
Copy code
vite {
    rolldownVersion.set("xxx")
}
which switches to
rolldown-vite
? But that wouldn't solve the current problem (which is that it doesn't work by default).
r
version.convention("npm:rolldown-vite@latest")
this is all you need to make it work by default
Just make
rolldown-vite
the default :)
c
Since it's experimental, do you know if there is some tracking of "how close they are to making it the default"? If it's almost there, sure! Thankfully we finally have a few automated tests so that should help discover issues
r
Beta is already released. It will be the default in 8.
version.convention("8.0.0-beta.2")
this is working perfectly fine, too
I think the issue should be about Vite 8 and not rolldown-vite.
I can make a MR if you want to check the code and make your own tests
c
Please do, maybe I can get it merged tomorrow