fix(nuxt3): respect custom public dir in layers (#4477)

This commit is contained in:
Daniel Roe 2022-04-20 21:07:01 +01:00 committed by GitHub
parent 975ec0c417
commit 78fcbcf16f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,7 @@ export async function initNitro (nuxt: Nuxt) {
dir: resolve(nuxt.options.buildDir, 'dist/client') dir: resolve(nuxt.options.buildDir, 'dist/client')
}, },
...nuxt.options._layers ...nuxt.options._layers
.map(layer => join(layer.config.srcDir, 'public')) .map(layer => join(layer.config.srcDir, layer.config.dir?.public || 'public'))
.filter(dir => existsSync(dir)) .filter(dir => existsSync(dir))
.map(dir => ({ dir })) .map(dir => ({ dir }))
], ],