-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(kit): support followSymbolicLinks
option for resolveFiles
#6240
Conversation
β Deploy Preview for nuxt3-docs canceled.
|
resolveFiles
by allowing opt-out of followSymbolicLinksfollowSymbolicLinks
option for resolveFiles
packages/kit/src/resolve.ts
Outdated
@@ -151,7 +151,7 @@ async function isDirectory (path: string) { | |||
return (await fsp.lstat(path)).isDirectory() | |||
} | |||
|
|||
export async function resolveFiles (path: string, pattern: string | string[]) { | |||
const files = await globby(pattern, { cwd: path, followSymbolicLinks: true }) | |||
export async function resolveFiles (path: string, pattern: string | string[], followSymbolicLinks: boolean = true) { |
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.
Can you please make 3rd argument an object { followSymbolicLinks }
Thanks for PR @Diizzayy. In the future, please consider opening an issue describing improvement and enhancement ππΌ Also what is the current use case you have for this utility for skipping link resolution? Knowing context, can help to improve utilities and be aware of usecases. |
Sorry about that, I had begun writing an issue when I realized that this was the underlying cause.
@pi0 When using pnpm workspaces which uses symlinks between packages, you'll find that based on how the resolveFiles utility is used in a module, it's default behavior ( following symlinks ) can result in scanning deeply nested files in |
π Description
This PR allows module authors to opt-out of following symbolic links when using
resolveFiles
, as there are many cases where this current default isn't the desired.