feat(kit): support followSymbolicLinks option for resolveFiles#6240
feat(kit): support followSymbolicLinks option for resolveFiles#6240
followSymbolicLinks option for resolveFiles#6240Conversation
✅ Deploy Preview for nuxt3-docs canceled.
|
resolveFiles by allowing opt-out of followSymbolicLinksfollowSymbolicLinks option for resolveFiles
packages/kit/src/resolve.ts
Outdated
|
|
||
| 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.
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.