Skip to content

Conversation

sapphi-red
Copy link
Member

Description

This PR adds rolldown-vite support to plugin-legacy.

This PR achieves that by downloading a built package that is published to pkg.pr.new on rolldown-vite repo and vendoring + loading that in the package.

The upsides of this approach are:

  • the tests for rolldown-vite + plugin-legacy is done on rolldown-vite side and can be develeoped easier than having the source code of plugin-legacy for rolldown-vite in this repository
  • users won't need to switch the package to a different one

The downsides of this approach are:

  • the package size and download size is bigger due to some duplicated code and dependencies only used for rolldown-vite support. that said, rolldown-vite already depends on babel which is huge, so I think this is not a problem
  • exports other than viteLegacyPlugin/default should be synced between the normal plugin-legacy and the one for rolldown-vite support. this limitation should be fine.

To update the version for rolldown-vite support, we can update this line:

// for rolldown-vite v7.0.9, check https://pkg.pr.new/~/vitejs/rolldown-vite
const PLUGIN_LEGACY_FOR_ROLLDOWN_VITE =
'https://pkg.pr.new/vitejs/rolldown-vite/@vitejs/plugin-legacy@5c52bbc'

@sapphi-red sapphi-red added plugin: legacy p3-significant High priority enhancement (priority) labels Jul 17, 2025
hi-ogawa
hi-ogawa previously approved these changes Jul 18, 2025
Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@sapphi-red sapphi-red modified the milestone: 7.1 Jul 18, 2025
@sapphi-red sapphi-red merged commit ab62ca4 into vitejs:main Jul 22, 2025
15 checks passed
@sapphi-red sapphi-red deleted the feat/legacy-add-rolldown-vite-support branch July 22, 2025 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-significant High priority enhancement (priority) plugin: legacy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants