Skip to content

Conversation

@lazuee
Copy link
Contributor

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

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',
   },

hi-ogawa
hi-ogawa previously approved these changes Jan 16, 2025
patak-dev
patak-dev previously approved these changes Jan 16, 2025
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
@patak-dev patak-dev dismissed stale reviews from hi-ogawa and themself via 47f9f1c January 23, 2025 13:00
@patak-dev patak-dev merged commit bc851e3 into vitejs:main Jan 23, 2025
15 checks passed
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