feat: introduce experimental v3 native plugins#483
Draft
shulaoda wants to merge 1 commit intorolldown-vitefrom
Draft
feat: introduce experimental v3 native plugins#483shulaoda wants to merge 1 commit intorolldown-vitefrom
shulaoda wants to merge 1 commit intorolldown-vitefrom
Conversation
ecc5731 to
165a101
Compare
097a16d to
747c24e
Compare
ce51c11 to
9ee6920
Compare
dba3281 to
d6b9c56
Compare
shulaoda
commented
Dec 3, 2025
d6b9c56 to
6eddf7b
Compare
6eddf7b to
689f9ba
Compare
shulaoda
commented
Dec 3, 2025
| renderBuiltUrl: undefined, | ||
| hmrPartialAccept: false, | ||
| enableNativePlugin: process.env._VITE_TEST_JS_PLUGIN ? false : 'v1', | ||
| enableNativePlugin: process.env._VITE_TEST_JS_PLUGIN ? false : true, |
Member
Author
There was a problem hiding this comment.
It needs to be reverted before merging.
689f9ba to
122013a
Compare
shulaoda
commented
Dec 3, 2025
sapphi-red
requested changes
Dec 3, 2025
| case 'v1': | ||
| case true: | ||
| return 1 | ||
| case true: |
Member
There was a problem hiding this comment.
Suggested change
| case true: | |
| case 'v2': | |
| case true: |
We should also update the jsdoc of enableNativePlugin option.
Member
Author
There was a problem hiding this comment.
I'm considering not adding the v2 option since the v2 implementation is still experimental and not fully stable. My current idea is to treat enableNativePlugin: true as enabling v2, while keeping v1 as the default behavior. 🤔
f627dd0 to
4c5f53a
Compare
51dfefc to
0b387c5
Compare
0b387c5 to
97a4abe
Compare
Member
Author
|
@sapphi-red Could you help me trigger the ecosystem CI? It seems I don’t have permission to do it. |
Member
Member
Author
|
I found some issues in the Vite ecosystem, and I’ll address them later. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
If you want to enable these new native plugins, you need to set
enableNativePlugin: true, the default value is'v2'. The v3 native plugins includeassetPlugin,assetImportMetaUrlPlugin,cssPlugin,cssPostPlugin,htmlPlugin,htmlInlineProxyPlugin, improvednativeManifestPluginandnativeBuildImportAnalysisPlugin.Warning
We've identified cases in the third-party ecosystem where plugins invoke hooks of the
vite:cssorvite:css-postbuilt-in plugins, such asunocss/unocss,ArnaudBarre/downwind,privatenumber/vite-css-modules, andredfox-mx/vite-lit-css. After migrating to native plugins, we need to find appropriate solutions for these use cases. See https://github.com/search?q=vite%3Acss-post&type=code