Skip to content

feat(nitro,schema,vite): add experimental support for nitro/vite - #35604

Merged
danielroe merged 1 commit into
mainfrom
feat/nitro-vite-env-api
Jul 20, 2026
Merged

danielroe merged 1 commit into
mainfrom
feat/nitro-vite-env-api

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

📚 Description

I'm not entirely happy with this so I'd like to sit with it for a bit, and would welcome review and testing.

this implements nitro/vite plugin. the major challenges at the moment are around the builder outputs API, so see #35463, #35601 and #35576.

we're currently doing some hacks regarding the app manifest and SSR styles, particularly in dev mode, that I would value feedback on.

the renderer itself doesn't change much because we already refactored it in #35422

@socket-security

socket-security Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​ampproject/​remapping@​2.3.010010010082100

View full report

@danielroe
danielroe force-pushed the feat/nitro-vite-env-api branch from 4302b0f to e4d96cb Compare July 16, 2026 16:20
@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@nuxt/kit

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

@nuxt/nitro-server

npm i https://pkg.pr.new/@nuxt/nitro-server@35604

nuxt

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

@nuxt/rspack-builder

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

@nuxt/schema

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

@nuxt/vite-builder

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

@nuxt/webpack-builder

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

commit: 524815f

@codspeed

codspeed Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 21 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing feat/nitro-vite-env-api (524815f) with main (0b6c7bd)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (6eacfb2) during the generation of this report, so 0b6c7bd was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@danielroe
danielroe force-pushed the feat/nitro-vite-env-api branch from 9911b32 to dd1f59f Compare July 16, 2026 17:15
@danielroe
danielroe force-pushed the feat/nitro-vite-env-api branch from dd1f59f to 1c81163 Compare July 17, 2026 08:35
Base automatically changed from fix/unctx-resolve to main July 17, 2026 10:17
@danielroe
danielroe force-pushed the feat/nitro-vite-env-api branch from 1c81163 to 529be72 Compare July 20, 2026 13:25
@danielroe
danielroe marked this pull request as ready for review July 20, 2026 13:25
Comment thread vitest.config.ts
// TODO: fix upstream in nitro
// `nitro/vite` keeps `RunnerManager` in process-global state, so all but
// one concurrent worker gets a 503: 'Vite environment "nitro" is unavailable'
...(entry.builder === 'nitro-vite' ? { fileParallelism: false } : {}),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

fyi @pi0

@coderabbitai

This comment has been minimized.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/nitro-server/src/index.ts`:
- Around line 489-496: Update the stub manifest construction in the build:before
hook to set its timestamp from the existing buildTimestamp variable instead of
generating a new Date.now() value, keeping it consistent with writeAppManifest
and latest.json.

In `@packages/nitro-server/src/runtime/utils/renderer/dev-css.ts`:
- Around line 13-22: The shared renderer manifest is being mutated with
request-specific development CSS, allowing concurrent requests to leak styles
into one another. Update patchDevClientCss in
packages/nitro-server/src/runtime/utils/renderer/dev-css.ts:13-22 to clone or
carry the CSS through request-local state instead of calling updateManifest on
the cached rendererContext; adjust the getRequestDependencies flows at
packages/nitro-server/src/runtime/handlers/renderer.ts:157-160 and
packages/nitro-server/src/runtime/handlers/island.ts:81-86 to consume that
request-local manifest.

In `@packages/vite/src/plugins/client-manifest.ts`:
- Around line 48-69: Update buildDevClientManifest so the envApi branch
constructs the client entry as /@fs${clientEntry}, preserving the existing
clientEntry value for non-envApi builds and the rest of the manifest behavior.

In `@test/matrix.ts`:
- Line 4: Update the TEST_BUILDER fallback in the builder declaration to use a
falsy-value fallback so an empty environment variable resolves to 'vite' instead
of producing an invalid empty builder.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 205bb9a9-4f38-45fb-a172-92e16a149dcf

📥 Commits

Reviewing files that changed from the base of the PR and between 012530c and 529be72.

⛔ Files ignored due to path filters (3)
  • packages/nitro-server/package.json is excluded by !**/package.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
  • test/fixtures/nitro-vite-environment/package.json is excluded by !**/package.json
📒 Files selected for processing (34)
  • docs/3.guide/6.going-further/8.builders.md
  • packages/kit/src/build.ts
  • packages/nitro-server/src/index.ts
  • packages/nitro-server/src/internal.d.ts
  • packages/nitro-server/src/runtime/handlers/island.ts
  • packages/nitro-server/src/runtime/handlers/renderer.ts
  • packages/nitro-server/src/runtime/middleware/dev-client-css.ts
  • packages/nitro-server/src/runtime/utils/renderer/dev-client-css.ts
  • packages/nitro-server/src/runtime/utils/renderer/dev-css.ts
  • packages/nitro-server/src/utils.ts
  • packages/nitro-server/src/vite.ts
  • packages/nuxt/src/core/nuxt.ts
  • packages/nuxt/src/core/plugins/prehydrate.ts
  • packages/nuxt/src/head/module.ts
  • packages/schema/src/builder-env.ts
  • packages/schema/src/config/experimental.ts
  • packages/schema/src/types/schema.ts
  • packages/ui-templates/styles.ts
  • packages/vite/src/plugins/client-manifest.ts
  • packages/vite/src/plugins/dev-server.ts
  • packages/vite/src/plugins/resolved-externals.ts
  • packages/vite/src/plugins/server-entry.ts
  • packages/vite/src/plugins/ssr-styles.ts
  • packages/vite/src/plugins/vite-node.ts
  • packages/vite/src/shared/server.ts
  • packages/vite/src/utils/css.ts
  • packages/vite/src/vite.ts
  • test/fixtures/dynamic-paths/nuxt.config.ts
  • test/fixtures/nitro-vite-environment/app/app.vue
  • test/fixtures/nitro-vite-environment/nuxt.config.ts
  • test/fixtures/nitro-vite-environment/tsconfig.json
  • test/matrix.ts
  • test/nitro-vite-environment.test.ts
  • vitest.config.ts
💤 Files with no reviewable changes (1)
  • packages/ui-templates/styles.ts

Comment thread packages/nitro-server/src/index.ts Resolved
Comment thread test/matrix.ts Resolved
@danielroe
danielroe force-pushed the feat/nitro-vite-env-api branch 2 times, most recently from 8c8f90a to ef6d813 Compare July 20, 2026 16:59
@danielroe
danielroe added this pull request to the merge queue Jul 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 20, 2026
@danielroe
danielroe force-pushed the feat/nitro-vite-env-api branch from ef6d813 to 2e7193a Compare July 20, 2026 18:28

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/nitro-server/src/index.ts`:
- Around line 550-558: Update the virtual-module registration loop around
NUXT_BUILD_OUTPUT_MAP to handle the nuxt/styles entry separately: use
nuxt.buildOutputs.ssrStyles as a path and expose it through an appropriate
virtual-module export or alias, rather than invoking it as a function. Keep the
existing provider-function handling unchanged for all other mapped outputs and
preserve the existing exclusions.
- Around line 528-541: Update writeAppManifest so it always writes the refreshed
manifest, including actual prerendered routes, to tempDir as well as the
existing output directory when nitroViteEnvironment is enabled. Preserve the
current latest.json and meta/${buildId}.json generation while ensuring the
`#app-manifest` alias continues resolving to the updated tempDir manifest.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8ac9b15f-7604-4c3b-9027-118417a95a79

📥 Commits

Reviewing files that changed from the base of the PR and between ef6d813 and 2e7193a.

⛔ Files ignored due to path filters (3)
  • packages/nitro-server/package.json is excluded by !**/package.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
  • test/fixtures/nitro-vite-environment/package.json is excluded by !**/package.json
📒 Files selected for processing (35)
  • docs/3.guide/6.going-further/8.builders.md
  • packages/kit/src/build.ts
  • packages/nitro-server/src/index.ts
  • packages/nitro-server/src/internal.d.ts
  • packages/nitro-server/src/runtime/handlers/island.ts
  • packages/nitro-server/src/runtime/handlers/renderer.ts
  • packages/nitro-server/src/runtime/middleware/dev-client-css.ts
  • packages/nitro-server/src/runtime/utils/renderer/dev-client-css.ts
  • packages/nitro-server/src/runtime/utils/renderer/dev-css.ts
  • packages/nitro-server/src/utils.ts
  • packages/nitro-server/src/vite.ts
  • packages/nuxt/src/core/nuxt.ts
  • packages/nuxt/src/core/plugins/prehydrate.ts
  • packages/nuxt/src/head/module.ts
  • packages/schema/src/builder-env.ts
  • packages/schema/src/config/experimental.ts
  • packages/schema/src/types/schema.ts
  • packages/ui-templates/styles.ts
  • packages/vite/src/plugins/client-manifest.ts
  • packages/vite/src/plugins/dev-server.ts
  • packages/vite/src/plugins/resolved-externals.ts
  • packages/vite/src/plugins/server-entry.ts
  • packages/vite/src/plugins/ssr-styles.ts
  • packages/vite/src/plugins/vite-node.ts
  • packages/vite/src/shared/server.ts
  • packages/vite/src/utils/css.ts
  • packages/vite/src/vite.ts
  • pnpm-workspace.yaml
  • test/fixtures/dynamic-paths/nuxt.config.ts
  • test/fixtures/nitro-vite-environment/app/app.vue
  • test/fixtures/nitro-vite-environment/nuxt.config.ts
  • test/fixtures/nitro-vite-environment/tsconfig.json
  • test/matrix.ts
  • test/nitro-vite-environment.test.ts
  • vitest.config.ts
💤 Files with no reviewable changes (1)
  • packages/ui-templates/styles.ts
🚧 Files skipped from review as they are similar to previous changes (23)
  • test/fixtures/nitro-vite-environment/nuxt.config.ts
  • test/fixtures/nitro-vite-environment/tsconfig.json
  • test/fixtures/nitro-vite-environment/app/app.vue
  • packages/nuxt/src/head/module.ts
  • packages/nitro-server/src/runtime/utils/renderer/dev-css.ts
  • packages/nitro-server/src/runtime/middleware/dev-client-css.ts
  • packages/nuxt/src/core/nuxt.ts
  • packages/schema/src/builder-env.ts
  • packages/vite/src/plugins/vite-node.ts
  • packages/nuxt/src/core/plugins/prehydrate.ts
  • packages/vite/src/plugins/dev-server.ts
  • packages/schema/src/types/schema.ts
  • packages/vite/src/utils/css.ts
  • packages/nitro-server/src/runtime/handlers/island.ts
  • packages/kit/src/build.ts
  • test/fixtures/dynamic-paths/nuxt.config.ts
  • test/matrix.ts
  • packages/schema/src/config/experimental.ts
  • packages/nitro-server/src/runtime/handlers/renderer.ts
  • packages/vite/src/plugins/server-entry.ts
  • packages/vite/src/plugins/ssr-styles.ts
  • vitest.config.ts
  • packages/vite/src/vite.ts

Comment on lines +528 to +541
const dir = nuxt.options.experimental.nitroViteEnvironment
? join(nitro.options.output.publicDir, manifestPrefix)
: tempDir
await fsp.mkdir(join(dir, 'meta'), { recursive: true })
await fsp.writeFile(join(dir, 'latest.json'), JSON.stringify({
id: buildId,
timestamp: buildTimestamp,
}))
await fsp.writeFile(join(tempDir, `meta/${buildId}.json`), JSON.stringify(manifest))
})
await fsp.writeFile(join(dir, `meta/${buildId}.json`), JSON.stringify(manifest))
}
// seed the manifest so `#app-manifest` resolves during bundling,
// and refresh it after prerendering with the actual prerendered routes
nitro.hooks.hook('rollup:before', writeAppManifest)
nitro.hooks.hook('prerender:done', writeAppManifest)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick win

Keep the #app-manifest alias source up-to-date.

When experimental.nitroViteEnvironment is enabled, writeAppManifest writes the updated manifest (with the actual prerendered routes) directly to nitro.options.output.publicDir.

However, the #app-manifest alias (configured on lines 486 and 502) still points to tempDir (<buildDir>/manifest/meta/<buildId>.json). Because tempDir is not updated after the build:before stub generation, any imports of #app-manifest during the build will read the stub manifest, resulting in missing prerendered routes in the bundled application.

Ensure the manifest in tempDir is also updated so that the alias resolves to the correct data.

🐛 Proposed fix
         const dir = nuxt.options.experimental.nitroViteEnvironment
           ? join(nitro.options.output.publicDir, manifestPrefix)
           : tempDir
         await fsp.mkdir(join(dir, 'meta'), { recursive: true })
         await fsp.writeFile(join(dir, 'latest.json'), JSON.stringify({
           id: buildId,
           timestamp: buildTimestamp,
         }))
         await fsp.writeFile(join(dir, `meta/${buildId}.json`), JSON.stringify(manifest))
+
+        if (dir !== tempDir) {
+          await fsp.writeFile(join(tempDir, `meta/${buildId}.json`), JSON.stringify(manifest))
+        }
       }
       // seed the manifest so `#app-manifest` resolves during bundling,
       // and refresh it after prerendering with the actual prerendered routes
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const dir = nuxt.options.experimental.nitroViteEnvironment
? join(nitro.options.output.publicDir, manifestPrefix)
: tempDir
await fsp.mkdir(join(dir, 'meta'), { recursive: true })
await fsp.writeFile(join(dir, 'latest.json'), JSON.stringify({
id: buildId,
timestamp: buildTimestamp,
}))
await fsp.writeFile(join(tempDir, `meta/${buildId}.json`), JSON.stringify(manifest))
})
await fsp.writeFile(join(dir, `meta/${buildId}.json`), JSON.stringify(manifest))
}
// seed the manifest so `#app-manifest` resolves during bundling,
// and refresh it after prerendering with the actual prerendered routes
nitro.hooks.hook('rollup:before', writeAppManifest)
nitro.hooks.hook('prerender:done', writeAppManifest)
const dir = nuxt.options.experimental.nitroViteEnvironment
? join(nitro.options.output.publicDir, manifestPrefix)
: tempDir
await fsp.mkdir(join(dir, 'meta'), { recursive: true })
await fsp.writeFile(join(dir, 'latest.json'), JSON.stringify({
id: buildId,
timestamp: buildTimestamp,
}))
await fsp.writeFile(join(dir, `meta/${buildId}.json`), JSON.stringify(manifest))
if (dir !== tempDir) {
await fsp.writeFile(join(tempDir, `meta/${buildId}.json`), JSON.stringify(manifest))
}
}
// seed the manifest so `#app-manifest` resolves during bundling,
// and refresh it after prerendering with the actual prerendered routes
nitro.hooks.hook('rollup:before', writeAppManifest)
nitro.hooks.hook('prerender:done', writeAppManifest)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/nitro-server/src/index.ts` around lines 528 - 541, Update
writeAppManifest so it always writes the refreshed manifest, including actual
prerendered routes, to tempDir as well as the existing output directory when
nitroViteEnvironment is enabled. Preserve the current latest.json and
meta/${buildId}.json generation while ensuring the `#app-manifest` alias continues
resolving to the updated tempDir manifest.

Comment on lines +550 to 558
// with `nitroViteEnvironment` these specifiers provided by `NuxtBuildOutputsPlugin`
if (!nuxt.options.experimental.nitroViteEnvironment) {
for (const [specifier, key] of Object.entries(NUXT_BUILD_OUTPUT_MAP)) {
if (specifier === 'nuxt/entry-chunk' || specifier === 'nuxt/entry-ids') {
continue // already registered above in the virtual block
}
nitroConfig.virtual![specifier] = () => nuxt.buildOutputs[key]()
}
nitroConfig.virtual![specifier] = () => nuxt.buildOutputs[key]()
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Handle ssrStyles correctly as a path, not a function.

The NUXT_BUILD_OUTPUT_MAP includes nuxt/styles, which maps to ssrStyles. According to the documentation, ssrStyles is a string (path) or undefined, not a function like the other value providers. Calling nuxt.buildOutputs[key]() when key is 'ssrStyles' will throw a TypeError in the legacy Rollup path.

You should handle ssrStyles separately by either returning a virtual module code that exports from the path, or setting up an alias.

🐛 Proposed fix
   // with `nitroViteEnvironment` these specifiers provided by `NuxtBuildOutputsPlugin`
   if (!nuxt.options.experimental.nitroViteEnvironment) {
     for (const [specifier, key] of Object.entries(NUXT_BUILD_OUTPUT_MAP)) {
       if (specifier === 'nuxt/entry-chunk' || specifier === 'nuxt/entry-ids') {
         continue // already registered above in the virtual block
       }
+      if (key === 'ssrStyles') {
+        nitroConfig.virtual![specifier] = () => {
+          const path = nuxt.buildOutputs.ssrStyles
+          return path ? `export * from ${JSON.stringify(path)}` : 'export default {}'
+        }
+        continue
+      }
       nitroConfig.virtual![specifier] = () => nuxt.buildOutputs[key]()
     }
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// with `nitroViteEnvironment` these specifiers provided by `NuxtBuildOutputsPlugin`
if (!nuxt.options.experimental.nitroViteEnvironment) {
for (const [specifier, key] of Object.entries(NUXT_BUILD_OUTPUT_MAP)) {
if (specifier === 'nuxt/entry-chunk' || specifier === 'nuxt/entry-ids') {
continue // already registered above in the virtual block
}
nitroConfig.virtual![specifier] = () => nuxt.buildOutputs[key]()
}
nitroConfig.virtual![specifier] = () => nuxt.buildOutputs[key]()
}
// with `nitroViteEnvironment` these specifiers provided by `NuxtBuildOutputsPlugin`
if (!nuxt.options.experimental.nitroViteEnvironment) {
for (const [specifier, key] of Object.entries(NUXT_BUILD_OUTPUT_MAP)) {
if (specifier === 'nuxt/entry-chunk' || specifier === 'nuxt/entry-ids') {
continue // already registered above in the virtual block
}
if (key === 'ssrStyles') {
nitroConfig.virtual![specifier] = () => {
const path = nuxt.buildOutputs.ssrStyles
return path ? `export * from ${JSON.stringify(path)}` : 'export default {}'
}
continue
}
nitroConfig.virtual![specifier] = () => nuxt.buildOutputs[key]()
}
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/nitro-server/src/index.ts` around lines 550 - 558, Update the
virtual-module registration loop around NUXT_BUILD_OUTPUT_MAP to handle the
nuxt/styles entry separately: use nuxt.buildOutputs.ssrStyles as a path and
expose it through an appropriate virtual-module export or alias, rather than
invoking it as a function. Keep the existing provider-function handling
unchanged for all other mapped outputs and preserve the existing exclusions.

@danielroe
danielroe added this pull request to the merge queue Jul 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 20, 2026
@danielroe
danielroe force-pushed the feat/nitro-vite-env-api branch from 2e7193a to 524815f Compare July 20, 2026 21:55

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/vite/src/plugins/ssr-styles.ts (1)

207-216: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Prefer using the environment closure variable for consistency.

While this.environment.name is functionally correct within Vite 6 plugins, other hooks in this plugin (like generateBundle, renderChunk, and transform) use the environment.name variable captured from the applyToEnvironment(environment) parameter. Using environment.name here ensures consistency across all plugin hooks.

💡 Proposed refactor
-          if (!envApi && this.environment.name === 'ssr') {
+          if (!envApi && environment.name === 'ssr') {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/vite/src/plugins/ssr-styles.ts` around lines 207 - 216, Update the
buildStart hook in the SSR styles plugin to use the closure-scoped
environment.name from applyToEnvironment(environment) instead of
this.environment.name, including the SSR condition and stylesPath resolution,
while preserving the existing behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/vite/src/plugins/ssr-styles.ts`:
- Around line 207-216: Update the buildStart hook in the SSR styles plugin to
use the closure-scoped environment.name from applyToEnvironment(environment)
instead of this.environment.name, including the SSR condition and stylesPath
resolution, while preserving the existing behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c0a069ae-ab1f-4cb5-b1bd-88bba2006698

📥 Commits

Reviewing files that changed from the base of the PR and between 2e7193a and 524815f.

⛔ Files ignored due to path filters (3)
  • packages/nitro-server/package.json is excluded by !**/package.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
  • test/fixtures/nitro-vite-environment/package.json is excluded by !**/package.json
📒 Files selected for processing (35)
  • docs/3.guide/6.going-further/8.builders.md
  • packages/kit/src/build.ts
  • packages/nitro-server/src/index.ts
  • packages/nitro-server/src/internal.d.ts
  • packages/nitro-server/src/runtime/handlers/island.ts
  • packages/nitro-server/src/runtime/handlers/renderer.ts
  • packages/nitro-server/src/runtime/middleware/dev-client-css.ts
  • packages/nitro-server/src/runtime/utils/renderer/dev-client-css.ts
  • packages/nitro-server/src/runtime/utils/renderer/dev-css.ts
  • packages/nitro-server/src/utils.ts
  • packages/nitro-server/src/vite.ts
  • packages/nuxt/src/core/nuxt.ts
  • packages/nuxt/src/core/plugins/prehydrate.ts
  • packages/nuxt/src/head/module.ts
  • packages/schema/src/builder-env.ts
  • packages/schema/src/config/experimental.ts
  • packages/schema/src/types/schema.ts
  • packages/ui-templates/styles.ts
  • packages/vite/src/plugins/client-manifest.ts
  • packages/vite/src/plugins/dev-server.ts
  • packages/vite/src/plugins/resolved-externals.ts
  • packages/vite/src/plugins/server-entry.ts
  • packages/vite/src/plugins/ssr-styles.ts
  • packages/vite/src/plugins/vite-node.ts
  • packages/vite/src/shared/server.ts
  • packages/vite/src/utils/css.ts
  • packages/vite/src/vite.ts
  • pnpm-workspace.yaml
  • test/fixtures/dynamic-paths/nuxt.config.ts
  • test/fixtures/nitro-vite-environment/app/app.vue
  • test/fixtures/nitro-vite-environment/nuxt.config.ts
  • test/fixtures/nitro-vite-environment/tsconfig.json
  • test/matrix.ts
  • test/nitro-vite-environment.test.ts
  • vitest.config.ts
💤 Files with no reviewable changes (1)
  • packages/ui-templates/styles.ts
🚧 Files skipped from review as they are similar to previous changes (28)
  • test/fixtures/nitro-vite-environment/tsconfig.json
  • packages/nitro-server/src/runtime/middleware/dev-client-css.ts
  • packages/nitro-server/src/internal.d.ts
  • pnpm-workspace.yaml
  • packages/nitro-server/src/runtime/utils/renderer/dev-client-css.ts
  • packages/nuxt/src/core/nuxt.ts
  • packages/vite/src/plugins/vite-node.ts
  • packages/vite/src/plugins/dev-server.ts
  • packages/schema/src/types/schema.ts
  • test/fixtures/nitro-vite-environment/nuxt.config.ts
  • packages/nitro-server/src/runtime/handlers/island.ts
  • packages/vite/src/vite.ts
  • packages/schema/src/builder-env.ts
  • packages/nitro-server/src/runtime/utils/renderer/dev-css.ts
  • packages/vite/src/utils/css.ts
  • packages/nuxt/src/head/module.ts
  • test/fixtures/nitro-vite-environment/app/app.vue
  • packages/schema/src/config/experimental.ts
  • packages/kit/src/build.ts
  • vitest.config.ts
  • test/fixtures/dynamic-paths/nuxt.config.ts
  • packages/nitro-server/src/runtime/handlers/renderer.ts
  • packages/nuxt/src/core/plugins/prehydrate.ts
  • packages/vite/src/plugins/resolved-externals.ts
  • test/matrix.ts
  • packages/nitro-server/src/utils.ts
  • packages/vite/src/plugins/server-entry.ts
  • packages/nitro-server/src/index.ts

@danielroe
danielroe added this pull request to the merge queue Jul 20, 2026
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.

1 participant