Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behaviour for BuildEntry.pattern resolution #512

Open
LucDeCaf opened this issue Feb 18, 2025 · 2 comments · May be fixed by #517
Open

Unexpected behaviour for BuildEntry.pattern resolution #512

LucDeCaf opened this issue Feb 18, 2025 · 2 comments · May be fixed by #517
Labels
bug Something isn't working

Comments

@LucDeCaf
Copy link

Environment

https://stackblitz.com/edit/stackblitz-starters-sh4sv7bx

Reproduction

  1. Run pnpm install && pnpm run build
  2. Check dist - .env.local is included in the build folder when *.local files have been excluded

Describe the bug

Because dotfiles are usually ignored by unbuild, trying to ignore local files while using builder: 'copy' by using pattern: ['*', '.*', '!*.local'] doesn't work for local dotfiles - to ignore local dotfiles you need to use '!.*.local', which works for this example but doesn't work for all builds.

I believe the expected behaviour would be for '..local' files to be included in '.local', as this is the behaviour in most tools (eg. node and git).

Additional context

No response

Logs

@LucDeCaf LucDeCaf added the bug Something isn't working label Feb 18, 2025
@zoeyzhao19
Copy link
Contributor

I think it's an expected behavior since the pattern is powered by picomatch and By default, dotfiles are ignored unless a . is explicitly defined in the pattern, or options.dot is true

@LucDeCaf
Copy link
Author

@zoeyzhao19 Fair - is there any way to hook into picomatch options from unbuild that you know of?

@kricsleo kricsleo linked a pull request Mar 1, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants