From d05af1870717372cd3fc48f47aa99cde0c4b986f Mon Sep 17 00:00:00 2001 From: Alex Vipond Date: Tue, 4 Aug 2020 08:38:33 -0600 Subject: [PATCH] docs(pluginutils): Correct minimatch to picomatch (#525) `createFilter` uses picomatch, not minimatch https://github.com/rollup/plugins/blob/5fa15590e452d568239a6d8e1c7018865c027fe4/packages/pluginutils/src/createFilter.ts#L3 The differences are pretty subtle, but I think it's important to document them for people with more specific use cases, and for people creating packages that depend on `createFilter`. --- packages/pluginutils/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/pluginutils/README.md b/packages/pluginutils/README.md index 2a103e6bd..7475be7af 100755 --- a/packages/pluginutils/README.md +++ b/packages/pluginutils/README.md @@ -99,14 +99,16 @@ export default function myPlugin(options = {}) { Constructs a filter function which can be used to determine whether or not certain modules should be operated upon. -Parameters: `(include?: , exclude?: , options?: Object)`
+Parameters: `(include?: , exclude?: , options?: Object)`
Returns: `String` #### `include` and `exclude` Type: `String | RegExp | Array[...String|RegExp]`
-A valid [`minimatch`](https://www.npmjs.com/package/minimatch) pattern, or array of patterns. If `options.include` is omitted or has zero length, filter will return `true` by default. Otherwise, an ID must match one or more of the `minimatch` patterns, and must not match any of the `options.exclude` patterns. +A valid [`picomatch`](https://github.com/micromatch/picomatch#globbing-features) pattern, or array of patterns. If `options.include` is omitted or has zero length, filter will return `true` by default. Otherwise, an ID must match one or more of the `picomatch` patterns, and must not match any of the `options.exclude` patterns. + +Note that `picomatch` patterns are very similar to [`minimatch`](https://github.com/isaacs/minimatch#readme) patterns, and in most use cases, they are interchangeable. If you have more specific pattern matching needs, you can view [this comparison table](https://github.com/micromatch/picomatch#library-comparisons) to learn more about where the libraries differ. #### `options`