fix(nitro): don't include current project's layer twice (#3785)

This commit is contained in:
Daniel Roe 2022-03-18 18:20:23 +00:00 committed by GitHub
parent 4b35915d6e
commit 73ee41cb58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,10 +177,7 @@ function startRollupWatcher (nitroContext: NitroContext) {
async function _watch (nitroContext: NitroContext) { async function _watch (nitroContext: NitroContext) {
let watcher = startRollupWatcher(nitroContext) let watcher = startRollupWatcher(nitroContext)
const serverDirs = [ const serverDirs = nitroContext._layers.map(layer => layer.serverDir)
...nitroContext._layers.map(layer => layer.serverDir),
nitroContext._nuxt.serverDir
]
nitroContext.scannedMiddleware = ( nitroContext.scannedMiddleware = (
await Promise.all(serverDirs.map(async dir => await scanMiddleware(dir, await Promise.all(serverDirs.map(async dir => await scanMiddleware(dir,