Write glob patterns that pick the right files and reject the rest: 18 levels of wildcards, * and **, character classes and brace expansion.
A glob is a pattern that picks files by their path. Terminals, .gitignore, vite.config, ESLint and nearly every JavaScript tool use them. * matches any run of characters except a slash /, so * stays inside one folder. In this world every folder is one cloth wrapped round a bundle: * only takes the bundles with no wrapping.
Curly braces {a,b,c} mean one of this list. An extension, a folder name, or a piece of a name. Each choice is written out whole, separated by commas, with no spaces.
` (two stars) standing on its own between slashes is called a globstar: it matches any number of folders, including none. / at the start means "in any folder". A single star *` still stays in one folder.
Square brackets [...] make a character class: it matches exactly one character from the set inside. Write it one by one ([123]) or as a range ([1-3], [a-z], [A-Z]).
An exclamation mark ! (or a caret ^) at the start of a class turns it round: [!_] matches any one character except the underscore. Files starting with _ often mark "private" files that must not be built.
* fills in any name, but it stops at a slash /.{js,ts} match one of the choices inside them.? matches exactly one character, not zero and not two.* for one level.[123] matches one character from that set. The range [1-3] means the same./ together with the right ending of the name.[!_] matches any one character except _. [^_] means the same./, the fixed name and braces for the extension.And more, 18 levels in all.