New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(nuxt): resolve nitro config entries in layers (nuxt aliases) #26679
base: main
Are you sure you want to change the base?
Conversation
Run & review this pull request in StackBlitz Codeflow. |
packages/nuxt/src/core/nitro.ts
Outdated
const { dir: rootDir, srcDir, alias: rootAlias } = nuxt.options | ||
await Promise.all(nuxt.options._layers.map((layer) => { | ||
return Promise.all((layer.config.nitro?.publicAssets || []).map(async (publicAsset) => { | ||
if (!publicAsset) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shold we use !publicAssets?.dir
instead: if so, we should also remove || rootDir.public || 'public'
from L617 and || layer.config.dir?.public || 'public'
from L618
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've exluded publicAssets
without dir
const dir = await resolvePath(path, { cwd, alias: alias as Record<string, string> }) | ||
// TODO: should warn if missing? | ||
if (existsSync(dir)) { | ||
publicAsset.dir = dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should warn or even throw?
chore: include scanDirs
馃敆 Linked issue
resolves #26517
馃摎 Description
publicAssets
andpublic
folders not being resolved and so we cannot use Nuxt alias.This PR also includes layers public directories to nitro configuration.