vite_ruby icon indicating copy to clipboard operation
vite_ruby copied to clipboard

Changes required to unbreak vite-rolldown

Open chen-anders opened this issue 4 months ago • 3 comments

Description 📖

This pull request contains changes to this plugin so that running vite with rolldown still works. I believe we're not inserting the correct entries into rolldownOptions causing us to run into this issue: https://github.com/vitejs/rolldown-vite/issues/371

Background 📜

Since rolldown-vite expects rolldownOptions instead of rollupOptions and somehow both are present when the plugin in the current state is run, rollupOptions gets discarded, which means all the settings built up from the config function get dropped (e.g entrypoints)

The Fix 🔨

This fix detects whether we're using rolldown and sets the options appropriately. In addition, I attempted to fix an issue where outputFileName was being passed an undefined value , causing vite to fail building assets. Once I added if (typeof name === "undefined") return ""; - everything started building again.

chen-anders avatar Aug 26 '25 14:08 chen-anders

It's not quite clear to me why my changes are causing test failures, but somehow all rails 7.2.x builds manage to pass 😓

chen-anders avatar Aug 26 '25 16:08 chen-anders

Thanks for putting this together!

gurgeous avatar Oct 07 '25 18:10 gurgeous

I tested this locally with

        "vite": "8.0.0-beta.0",

on a rails app and it built with no problems

vite 8 = built in 2.99s vite 5 = built in 7.23s

dmix avatar Dec 03 '25 22:12 dmix

Was also able to test this on a rails 7.x app with a largish vue-front end and 8.0.0-beta.1 and it worked fine with a few tweaks to our vite.config.mjs. I didn't see a noticible difference in build times.

etherbob avatar Dec 15 '25 17:12 etherbob

Thanks Anders!

ElMassimo avatar Jan 02 '26 21:01 ElMassimo

Thanks @ElMassimo!

gurgeous avatar Jan 03 '26 01:01 gurgeous