Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change ResolvedConfig type to interface to allow extending it #19210

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lazuee
Copy link

@lazuee lazuee commented Jan 16, 2025

Description

This PR changes ResolvedConfig from a type to an interface, allowing it to be extended for various use cases, including plugin development.

Closes: #15473

@lazuee lazuee changed the title fix(config): change ResolvedConfig type to interface to allow extending it (#15473) fix: change ResolvedConfig type to interface to allow extending it Jan 16, 2025
Copy link
Collaborator

@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.

Looking at your example #15473 (comment) where optional one is in UserConfig and strict one is in ResolvedConfig, I think this change makes sense.

The build failure is probably because dts bundling is too sensitive to some ordering. Can you try this diff?

Diff
diff --git a/packages/vite/rollup.dts.config.ts b/packages/vite/rollup.dts.config.ts
index 46306f0a2..f1ba14b3b 100644
--- a/packages/vite/rollup.dts.config.ts
+++ b/packages/vite/rollup.dts.config.ts
@@ -50,10 +50,10 @@ const identifierReplacements: Record<string, Record<string, string>> = {
     Plugin$1: 'rollup.Plugin',
     PluginContext$1: 'rollup.PluginContext',
     TransformPluginContext$1: 'rollup.TransformPluginContext',
-    TransformResult$2: 'rollup.TransformResult',
+    TransformResult$1: 'rollup.TransformResult',
   },
   esbuild: {
-    TransformResult$1: 'esbuild_TransformResult',
+    TransformResult$2: 'esbuild_TransformResult',
     TransformOptions$1: 'esbuild_TransformOptions',
     BuildOptions$1: 'esbuild_BuildOptions',
   },

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

Sounds good, let's merge this one in 6.1

@patak-dev patak-dev added this to the 6.1 milestone Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ResolvedConfig interface
3 participants