@nuxt/schema-nightly 5.0.0-29655957.274d46bb → 5.0.0-29656176.781598bf

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -382,6 +382,15 @@ type NuxtConfigLayer = ResolvedConfig<NuxtConfig & {
382
382
  interface DefineNuxtConfig<Config extends UserInputConfig = NuxtConfig> extends DefineConfig<Config, ConfigLayerMeta> {}
383
383
  interface NuxtBuilder {
384
384
  bundle: (nuxt: Nuxt) => Promise<void>;
385
+ /**
386
+ * Optional. If provided and the user opts in via `experimental.watcher: 'builder'`,
387
+ * Nuxt will call this instead of starting its own file watcher in dev mode,
388
+ * allowing the builder to reuse its own watcher.
389
+ *
390
+ * The builder is expected to register its own `nuxt.hook('close', ...)` to
391
+ * clean up any resources it allocates.
392
+ */
393
+ setupWatcher?: (nuxt: Nuxt) => Promise<void> | void;
385
394
  }
386
395
  interface NuxtOptions extends Omit<ConfigSchema, "vue" | "sourcemap" | "debug" | "builder" | "postcss" | "webpack"> {
387
396
  vue: Omit<ConfigSchema["vue"], "config"> & {
@@ -2043,13 +2052,15 @@ interface ConfigSchema {
2043
2052
  * You can set this instead to `parcel` to use `@parcel/watcher`, which may improve performance in large projects or on Windows platforms.
2044
2053
  * You can also set this to `chokidar` to watch all files in your source directory.
2045
2054
  *
2055
+ * Set to `'builder'` to reuse the active builder's own file watcher (e.g. Vite's `server.watcher`) instead of starting a second one. If the active builder does not provide a watcher, Nuxt falls back to its default selection.
2056
+ *
2046
2057
  * @see [chokidar](https://github.com/paulmillr/chokidar)
2047
2058
  *
2048
2059
  * @see [@parcel/watcher](https://github.com/parcel-bundler/watcher)
2049
2060
  *
2050
- * @default 'chokidar-granular' if `srcDir` is the same as `rootDir`, otherwise 'chokidar'
2061
+ * @default 'builder' if `future.compatibilityVersion` >= 5, otherwise 'chokidar-granular' if `srcDir` is the same as `rootDir`, otherwise 'chokidar'
2051
2062
  */
2052
- watcher: "chokidar" | "parcel" | "chokidar-granular";
2063
+ watcher: "chokidar" | "parcel" | "chokidar-granular" | "builder";
2053
2064
  /**
2054
2065
  * Enable native async context to be accessible for nested composables
2055
2066
  *
package/dist/index.mjs CHANGED
@@ -612,8 +612,10 @@ var experimental_default = defineResolvers({
612
612
  if (typeof val === "string" && new Set([
613
613
  "chokidar",
614
614
  "parcel",
615
- "chokidar-granular"
615
+ "chokidar-granular",
616
+ "builder"
616
617
  ]).has(val)) return val;
618
+ if (await get("future.compatibilityVersion") >= 5) return "builder";
617
619
  const [srcDir, rootDir] = await Promise.all([get("srcDir"), get("rootDir")]);
618
620
  if (srcDir === rootDir) return "chokidar-granular";
619
621
  return "chokidar";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/schema-nightly",
3
- "version": "5.0.0-29655957.274d46bb",
3
+ "version": "5.0.0-29656176.781598bf",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",