Skip to content

Move to per-environment APIs

Feedback

Give us feedback at Environment API feedback discussion

Multiple APIs from ViteDevServer related to module graph has replaced with more isolated Environment APIs.

  • server.moduleGraph -> environment.moduleGraph
  • server.transformRequest -> environment.transformRequest
  • server.warmupRequest -> environment.warmupRequest

Affect scope: Vite Plugin Authors

Future Deprecation

The Environment instance was first introduced at v6.0. The deprecation of server.moduleGraph and other methods that are now in environments is planned for v7.0. We don't recommend moving away from server methods yet. To identify your usage, set these in your vite config.

ts
future: {
  removeServerModuleGraph: 'warn',
  removeServerTransformRequest: 'warn',
}

Motivation

// TODO:

Migration Guide

// TODO:

Released under the MIT License. (9b8c2af4)