mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-31 15:50:32 +00:00
fix(nuxt): improve watcher logs slightly (#23857)
This commit is contained in:
parent
3888071526
commit
06e6140953
@ -146,7 +146,11 @@ async function createParcelWatcher () {
|
|||||||
console.time('[nuxt] builder:parcel:watch')
|
console.time('[nuxt] builder:parcel:watch')
|
||||||
}
|
}
|
||||||
const watcherPath = await tryResolveModule('@parcel/watcher', [nuxt.options.rootDir, ...nuxt.options.modulesDir])
|
const watcherPath = await tryResolveModule('@parcel/watcher', [nuxt.options.rootDir, ...nuxt.options.modulesDir])
|
||||||
if (watcherPath) {
|
if (!watcherPath) {
|
||||||
|
logger.warn('Falling back to `chokidar-granular` as `@parcel/watcher` cannot be resolved in your project.')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
const { subscribe } = await import(pathToFileURL(watcherPath).href).then(interopDefault) as typeof import('@parcel/watcher')
|
const { subscribe } = await import(pathToFileURL(watcherPath).href).then(interopDefault) as typeof import('@parcel/watcher')
|
||||||
for (const layer of nuxt.options._layers) {
|
for (const layer of nuxt.options._layers) {
|
||||||
if (!layer.config.srcDir) { continue }
|
if (!layer.config.srcDir) { continue }
|
||||||
@ -173,9 +177,6 @@ async function createParcelWatcher () {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
logger.warn('Falling back to `chokidar-granular` as `@parcel/watcher` cannot be resolved in your project.')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
async function bundle (nuxt: Nuxt) {
|
async function bundle (nuxt: Nuxt) {
|
||||||
try {
|
try {
|
||||||
|
@ -76,7 +76,7 @@ export default defineNuxtModule({
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
logger.warn('Falling back to `chokidar-granular` as `@parcel/watcher` cannot be resolved in your project.')
|
logger.warn('Falling back to `chokidar` as `@parcel/watcher` cannot be resolved in your project.')
|
||||||
}
|
}
|
||||||
|
|
||||||
const filesToWatch = await Promise.all(nuxt.options._layers.map(layer =>
|
const filesToWatch = await Promise.all(nuxt.options._layers.map(layer =>
|
||||||
|
Loading…
Reference in New Issue
Block a user