Repository navigation
feat(devtools): enable dev server integration - #1
anurag6569201 wants to merge 1 commit into
Conversation
Source PR: vitejs#23333 Source head: 8d6ae3d
|
| "peerDependencies": { | ||
| "@types/node": "^20.19.0 || >=22.12.0", | ||
| "@vitejs/devtools": "^0.4.0 || ^0.5.0", | ||
| "@vitejs/devtools": "^0.7.1", |
There was a problem hiding this comment.
Shipwright · HIGH
The peer dependency range for '@vitejs/devtools' is narrowed from '^0.4.0 || ^0.5.0' to exactly '^0.7.1', which is a breaking peer dependency change for consumers on older devtools
Impact: The peer dependency range for '@vitejs/devtools' is narrowed from '^0.4.0 || ^0.5.0' to exactly '^0.7.1', which is a breaking peer dependency change for consumers on older devtools versions. This can cause install failures or force unexpected upgrades in downstream projects.
Suggested fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright.
Background
Vite's experimental
devtoolsoption currently supports build-time analysis only. When enabled, Vite loads a single build integration plugin that configures Rolldown analysis and starts Vite DevTools after the build.Using Vite DevTools during development still requires users to register the
DevTools()plugin manually invite.config.ts. This creates two separate setup paths for development and build analysis.vitejs/devtools#541 prepares
@vitejs/devtoolsfor first-class Vite integration by:devtools.applywith'serve','build', and'all'DevToolsIntegration()return an async plugin arrayDevTools()plugins in serve modeThis PR is the corresponding Vite Core integration for
@vitejs/devtools0.6.0.Changes
@vitejs/devtools0.6.0.devtoolsintegration for bothserveandbuild.DevToolsIntegration().sortUserPlugins()helper to preserve each integration plugin'spre, normal, orpostenforcement order.DevTools()manually.devtools.applythrough the resolved DevTools configuration.enabled: falseis explicitly set.@vitejs/devtools-viteis required for dev-server inspection.@vitejs/devtools-rolldownis required for build analysis.serveandbuildby default.Breaking changes
These changes only affect the experimental
devtoolsoption.devtools: truenow enables DevTools during both development and production builds. Previously, it only enabled build-time analysis.To preserve the previous behavior:
A DevTools configuration object now enables the integration by default. Previously, an object without
enabled: truewas treated as disabled.Use
enabled: falseto disable it explicitly:The minimum supported
@vitejs/devtoolsversion is now 0.6.0 because Vite Core relies on the new async plugin-array integration contract.Build analysis and dev-server inspection remain opt-in integrations. Users need to install the corresponding package:
For build analysis:
Screenshot
Source merge-base:
1c46db555d2927fc62686341911b03f6d365a36aSource head:
8d6ae3dc91d0a157db212be7d656e1d9802b3085