mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-25 10:08:29 +00:00
fix(nuxt,schema): resolve shared
dir from config (#31091)
This commit is contained in:
parent
ed3b9815cd
commit
d1733365f8
@ -57,8 +57,8 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
sharedDirs.add(resolve(layer.config.rootDir, 'shared', 'utils'))
|
sharedDirs.add(resolve(layer.config.rootDir, layer.config.dir?.shared ?? 'shared', 'utils'))
|
||||||
sharedDirs.add(resolve(layer.config.rootDir, 'shared', 'types'))
|
sharedDirs.add(resolve(layer.config.rootDir, layer.config.dir?.shared ?? 'shared', 'types'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,8 +79,8 @@ export default defineNuxtModule<Partial<ImportsOptions>>({
|
|||||||
composablesDirs.push(resolve(layer.config.srcDir, 'utils'))
|
composablesDirs.push(resolve(layer.config.srcDir, 'utils'))
|
||||||
|
|
||||||
if (isNuxtV4) {
|
if (isNuxtV4) {
|
||||||
composablesDirs.push(resolve(layer.config.rootDir, 'shared', 'utils'))
|
composablesDirs.push(resolve(layer.config.rootDir, layer.config.dir?.shared ?? 'shared', 'utils'))
|
||||||
composablesDirs.push(resolve(layer.config.rootDir, 'shared', 'types'))
|
composablesDirs.push(resolve(layer.config.rootDir, layer.config.dir?.shared ?? 'shared', 'types'))
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const dir of (layer.config.imports?.dirs ?? [])) {
|
for (const dir of (layer.config.imports?.dirs ?? [])) {
|
||||||
|
@ -405,7 +405,11 @@ export default defineResolvers({
|
|||||||
/**
|
/**
|
||||||
* The shared directory. This directory is shared between the app and the server.
|
* The shared directory. This directory is shared between the app and the server.
|
||||||
*/
|
*/
|
||||||
shared: 'shared',
|
shared: {
|
||||||
|
$resolve: (val) => {
|
||||||
|
return val && typeof val === 'string' ? val : 'shared'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The directory containing your static files, which will be directly accessible via the Nuxt server
|
* The directory containing your static files, which will be directly accessible via the Nuxt server
|
||||||
|
Loading…
Reference in New Issue
Block a user