Skip to content

Conversation

@danielroe
Copy link
Member

@danielroe danielroe commented Sep 18, 2025

🔗 Linked issue

📚 Description

This migrates us to using the Vite Environment API.

It's an early draft and needs much testing. However, optimistically (!) ... I tested on https://github.com/nuxt/nuxt.com and with one small change (nuxt/ui#5008) everything worked fine in development.

🚧 TODO

  • support the Nuxt vitest runtime environment - this may need to happen in @nuxt/test-utils directly instead of here
  • document breaking changes and possibly allow opting in to this (or releasing a separate vite-builder)
  • add warnings when using deprecated hooks (and/or try to handle it by calling config() hooks of plugins injected in this way)
  • investigate increased bundle size (likely composable tree-shaking is not working as expected)
  • fix runtime compiler implementation
  • resolve deep imports plugin likely needs to be updated too

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@danielroe danielroe marked this pull request as draft September 18, 2025 15:19
@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 18, 2025

Open in StackBlitz

@nuxt/kit

npm i https://pkg.pr.new/@nuxt/kit@33262

nuxt

npm i https://pkg.pr.new/nuxt@33262

@nuxt/rspack-builder

npm i https://pkg.pr.new/@nuxt/rspack-builder@33262

@nuxt/schema

npm i https://pkg.pr.new/@nuxt/schema@33262

@nuxt/vite-builder

npm i https://pkg.pr.new/@nuxt/vite-builder@33262

@nuxt/webpack-builder

npm i https://pkg.pr.new/@nuxt/webpack-builder@33262

commit: aeee4a7

@danielroe danielroe added 5.x and removed 4.x labels Sep 18, 2025
@danielroe danielroe changed the title refactor(vite): move logic into separate vite plugins feat(vite)!: migrate to environment api Sep 18, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 18, 2025

CodSpeed Performance Report

Merging #33262 will improve performances by 25.68%

Comparing feat/vite-env-api (aeee4a7) with main (191bcb7)

Summary

⚡ 1 improvement
✅ 9 untouched

Benchmarks breakdown

Benchmark BASE HEAD Change
initial production build in the minimal test fixture 5.8 s 4.6 s +25.68%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants