Rolldown support
Any plan to support rolldown? It getting more and more traction and it'd be great if wxt support it https://www.npmjs.com/package/rolldown-vite
Vite itself will switch to Rolldown sometime in the near future. There isn't really any advantage in WXT trying to support it before its fully stable with Vite.
Vite itself will switch to Rolldown sometime in the near future. There isn't really any advantage in WXT trying to support it before its fully stable with Vite.
That, you can however do a override to swap out vite with rolldown yourself to test using pnpm for example
Vite itself will switch to Rolldown sometime in the near future. There isn't really any advantage in WXT trying to support it before its fully stable with Vite.
That, you can however do a override to swap out vite with rolldown yourself to test using pnpm for example
I suppose preparing for it doesn’t hurt, especially with regard to the custom Vite plugins in WXT. 😁
@Timeraa tried this out, there is one problem: https://discord.com/channels/1212416027611365476/1224507127863967784/1380229842338975744
[plugin wxt:multipage-move] Error: This plugin assigns to bundle variable. This is discouraged by Rollup and is not supported by Rolldown. This will be ignored.
at Object.set (file:///Users/timeraa/Developer/PreMiD/Extension-alphaBeta/node_modules/.pnpm/[email protected]/node_modules/rolldown/dist/shared/src-C1CX2gm4.mjs:3377:18)
at PluginContextImpl.writeBundle (file:///Users/timeraa/Developer/PreMiD/Extension-alphaBeta/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected][email protected]/node_modules/wxt/dist/core/builders/vite/plugins/multipageMove.mjs:40:31)
Here's the rolldown code that throws the error:
https://github.com/rolldown/rolldown/blob/0a985f3e76de2626cba33fe96a4efb4a0ef70c2f/packages/rolldown/src/utils/transform-to-rollup-output.ts#L169
Additionally, there are some custom transforms, loads, and resolves that can take advantage of the new filter pattern.
This happens because I edit with the bundle before files are written to the output directory so I can control where HTML files are written to. But I guess that's discouraged... So we need to find a different way of controlling the output path for HTML files.
https://github.com/wxt-dev/wxt/blob/bfc8866b69d0b52afb92d29601c1cf99f9f06f8b/packages/wxt/src/core/builders/vite/plugins/multipageMove.ts#L63-L68
Actually, we could try just removing these lines, or moving this logic to the generateBundle hook. We update the bundle for two reasons:
- the bundle analysis display the right path
- The build output that shows files is correct (maybe, I might read the files off the disk for this, I can't remember)
So first thing we should try is moving this logic into the generateBundle hook.
OK, looks like HTML files aren't in the bundle until writeBundle. So that won't work :/
OK, I think I got something working...
Yup, I have a workaround working for the wxt:multipage-move plugin. See #1715. Will add other optimizations to that PR as well.
I've broken out the other optimizations into separate issues, they weren't as simple as I thought.
+1. we're using rolldown-vite in our web app which lives in a monorepo with our chrome extension. we'd love to move to WXT for the extension and being able to use the same version of vite throughout the repo would really simplify the migration.
You can use it today! There are just a few warnings and performance optimizations we're working on fixing, but it does work on the latest version of WXT