GeezerVison is showing github.com — Better Nuxt/Astro integration · Issue #1506 · voidzero-dev/vite-plus
Better Nuxt/Astro integration #1506DescriptionDescription
Currently, it feels like vite-plus and nuxt/astro provide two different interfaces that don't talk to each other. In particular,
- Nuxt/astro config cannot be used to specify vite+ config (see Use
nuxt.config.ts / astro.config.mjs as Vite+ config for Nuxt/Astro #912)
vp dev and vp build don't call the correct nuxt/astro commands (see Running vp dev on a new Astro project doesn't work #1123)
(both issues were raised before but are now closed although they are not fixed)
Suggested solution
ad 1: create an offical vite+ nuxt/astro module that reads the vite+ config from nuxt/astro.config and exposes it in the temporary framework folder (eg .nuxt/viteplus.config.mjs), and in vite+ add a fallback to those known locations if a main vite.config is missing.
ad 2: recognize that the project is using nuxt/astro, and then call the correct framework commands
Alternative
No response
Additional context
No response
Validations
- Read the Contributing Guidelines.
- Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
- Check that there isn't already an issue requesting the same feature.
Reacted by Max, Jordan Yoon-Buck, Mario Neuhold, Roman Kováč, ryohidaka, Dennis, John Campion Jr, Jody Hoon-Starr, RedlicaDev, Thomas McDonald and 13 more Reacted by Max ActivityCharles5277 commented on May 2, 2026 +1 — hitting the exact warning on a Nuxt 4 + Vite+ 0.1.14 project, and the previous discussion in #912 left a real gap that's worth re-surfacing.
The closing rationale in #912 ("if Nuxt wants to coexist with vite.config.ts, they should support export const nuxtConfig = … in it") puts the burden on Nuxt, but Nuxt's checkForExternalConfigurationFiles() has been there since 3.x and nuxt dev / nuxt build warn on every run regardless of file content. So as long as Vite+ requires a root vite.config.ts, every Nuxt+Vite+ user gets a permanent warning they can't silence.
What makes this hard to work around in our case specifically:
- The Vite+ docs already point users at
.oxlintrc.* / .oxfmtrc.* as a fallback for vp lint / vp fmt, so those two commands aren't blocking.
vp staged has no such fallback. vp staged --help says "using staged config from vite.config.ts", the migration guide explicitly says "only the staged config format is supported", and there's no --config flag. So we cannot keep vp staged (which is the recommended pre-commit entrypoint) without keeping a root vite.config.ts.
- Falling back to husky + lint-staged just to drop
vite.config.ts defeats the point of adopting Vite+ as a unified toolchain.
Net effect: any project that follows Vite+'s recommended commit-hook setup and uses Nuxt is forced into a permanent warning loop with no ergonomic exit.
A few possible directions, in increasing order of invasiveness:
- Accept a non-
vite.config.* filename for vp staged only (e.g. --config flag, or auto-discover .viteplus/staged.ts). This sidesteps the Nuxt detector without committing to a full alternative-config scheme.
- The official Nuxt module proposed in this issue's body — read Vite+ config from
nuxt.config.ts and emit .nuxt/viteplus.config.mjs. Best long-term answer but biggest scope.
- Coordinate with Nuxt to add an opt-in allowlist on the
checkForExternalConfigurationFiles warning so users can declare "this vite.config.ts belongs to a non-Vite tool, please don't warn." Cheapest but requires upstream agreement on both sides.
Happy to file a separate vp staged --config issue if maintainers think that's a more tractable starting point than the full Nuxt-module proposal. Deeyuude commented on May 19, 2026 Any updates on this please ? danielroe commented on Aug 13, 2026 unsurprisingly, I would welcome better integration with vite-plus. it seems strange to me that vp dev directly launching vite is a thing, because it makes vite-plus exclusive to the subset of frameworks that use the vite cli directly, rather than under-the-hood - whereas vite itself treats all frameworks built with it as first-class citizens.
things that I'm exploring on my end:
but it seems to me that simply detecting nuxt.config.ts or astro.config.mjs and refusing to start a dev server or build with a 'did you mean vp run dev' message would already be a better DX. Reacted by Tobias Diez, miguelrk, Bo Lingen and Ken Kieu Reacted by MK (fengmk2), Max, Josiah Grice, miguelrk and Ken Kieu fengmk2 commented on Aug 13, 2026
but it seems to me that simply detecting nuxt.config.ts or astro.config.mjs and refusing to start a dev server or build with a 'did you mean vp run dev' message would already be a better DX.
Sure, we can make this small improvement first👍 Reacted by JongKyung Lee , Max and Daniel Roe fengmk2 commented on Aug 14, 2026 @danielroe #2259 has already implemented a similar prompt improvement. Now when running vp dev under a nuxt project, it will prompt the user to execute vpr dev instead.
$ vp dev
VITE+ - The Unified Toolchain for the Web
note: You are running `vp dev` as a Vite+ built-in command. If you meant to run the dev npm script, use `vpr dev` instead.
VITE+ v0.2.9
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h + enter to show help maxdzin commented on Aug 14, 2026 @fengmk2 the problem is that by default, nuxt expect 3000 port, not 5173. So devserver launches incorrectly. ubugeeei commented on Nov 4, 2026 My concern with generating vite.config.ts is that users also need a place to write their own project-specific configuration, such as Vite+'s task runner settings.
If vite.config.ts is treated as generated output, those settings would need to live somewhere else, potentially in nuxt.config.ts, similar to how we customize Nuxt's generated TypeScript configuration today. That would mean routing configuration through Nuxt even when it isn't related to Nuxt itself.
Task runner settings are just one example. The same concern applies to future extensions to vite.config.ts: users should be able to configure those directly, without having to express them through Nuxt's configuration model.
For users who want to manage vite.config.ts themselves, I think an opt-in Nuxt Vite plugin would be a better fit. Conceptually, something like:
// vite.config.ts
export default defineConfig({
plugins: [nuxt(nuxtConfig)],
// Project-specific Vite / Vite+ configuration lives here.
})
This would let the project's vite.config.ts serve as the entry point, with Nuxt-specific configuration passed to the plugin. Users could then configure Vite, Vite+, and future extensions in the same place, while Nuxt focuses on its own framework-specific concerns.
Is using Nuxt this way also part of what you're exploring with nuxt/vite?
/cc @wattanx Reacted by Ryota Watanabe, JongKyung Lee , MK (fengmk2), Liang and Daniel Roe
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|