Skip to content

Commit 70780a0

Browse files
p-kuenshellscape
andauthored
refactor(pluginutils): replace micromatch with picomatch. (#306)
* Replace micromatch with more lightweight picomatch. This reduces dependency size. * pluginutils: replace picomatch types with @types/picomatch. * chore: update pnpm lock Co-authored-by: shellscape <andrew@shellscape.org>
1 parent 96e0900 commit 70780a0

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

packages/pluginutils/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@
4949
"dependencies": {
5050
"@types/estree": "0.0.39",
5151
"estree-walker": "^1.0.1",
52-
"micromatch": "^4.0.2"
52+
"picomatch": "^2.2.2"
5353
},
5454
"devDependencies": {
5555
"@rollup/plugin-commonjs": "^11.0.2",
5656
"@rollup/plugin-node-resolve": "^7.1.1",
5757
"@rollup/plugin-typescript": "^3.0.0",
5858
"@types/jest": "^24.9.0",
59-
"@types/micromatch": "^3.1.1",
6059
"@types/node": "^12.12.25",
60+
"@types/picomatch": "^2.2.1",
6161
"typescript": "^3.7.5"
6262
},
6363
"ava": {

packages/pluginutils/src/createFilter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { resolve, sep, posix } from 'path';
22

3-
import mm from 'micromatch';
3+
import pm from 'picomatch';
44

55
import { CreateFilter } from '../types';
66

@@ -34,7 +34,7 @@ const createFilter: CreateFilter = function createFilter(include?, exclude?, opt
3434
test: (what: string) => {
3535
// this refactor is a tad overly verbose but makes for easy debugging
3636
const pattern = getMatcherString(id, resolutionBase);
37-
const fn = mm.matcher(pattern, { dot: true });
37+
const fn = pm(pattern, { dot: true });
3838
const result = fn(what);
3939

4040
return result;

pnpm-lock.yaml

Lines changed: 14 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)