I originally raised this as a behaviour difference in a consumer project as a difference after switching to tinyglobby webpack/copy-webpack-plugin#788 (comment), but I was asked to raise it upstream since it's perceived to be a possible bug.
Using braced groups with initial ** wildcards behaves inconsistently. In my particular case:
Folder structure:
.well-known
- b.txt
regular
- c.txt
index.mjs
package.json
console.log(await glob('{.well-known/**/*,**/*}', { ignore: ['node_modules'] }));
// -> ['.well-known/b.txt', 'regular/c.txt']
i.e. the **/* part of the pattern is unable to detect top-level files like it would if not inside {}.
This applies regardless of the order of the branches.
A more contrived example shows that this inability to match ** with the top-level directory applies to all branches:
console.log(await glob('{**/*.mjs,**/*.json}', { ignore: ['node_modules'] }));
// -> []
I originally raised this as a behaviour difference in a consumer project as a difference after switching to tinyglobby webpack/copy-webpack-plugin#788 (comment), but I was asked to raise it upstream since it's perceived to be a possible bug.
Using braced groups with initial
**wildcards behaves inconsistently. In my particular case:Folder structure:
i.e. the
**/*part of the pattern is unable to detect top-level files like it would if not inside{}.This applies regardless of the order of the branches.
A more contrived example shows that this inability to match
**with the top-level directory applies to all branches: