Skip to content

Commit

Permalink
refactor: switch from fast-glob to tinyglobby
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Dec 2, 2024
1 parent 36987d4 commit 37253e3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
7 changes: 2 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
"webpack": "^5.1.0"
},
"dependencies": {
"fast-glob": "^3.3.2",
"glob-parent": "^6.0.1",
"globby": "^14.0.1",
"normalize-path": "^3.0.0",
"schema-utils": "^4.2.0",
"serialize-javascript": "^6.0.2"
"serialize-javascript": "^6.0.2",
"tinyglobby": "^0.2.10"
},
"devDependencies": {
"@babel/cli": "^7.24.6",
Expand Down
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ const getSerializeJavascript = memoize(() =>
require("serialize-javascript"),
);

const getFastGlob = memoize(() =>
const getTinyGlobby = memoize(() =>
// eslint-disable-next-line global-require
require("fast-glob"),
require("tinyglobby"),
);

const getGlobby = memoize(async () => {
Expand Down Expand Up @@ -359,7 +359,7 @@ class CopyPlugin {

pattern.context = absoluteFrom;
glob = path.posix.join(
getFastGlob().escapePath(
getTinyGlobby().escapePath(
getNormalizePath()(path.resolve(absoluteFrom)),
),
"**/*",
Expand All @@ -376,7 +376,7 @@ class CopyPlugin {
logger.debug(`added '${absoluteFrom}' as a file dependency`);

pattern.context = path.dirname(absoluteFrom);
glob = getFastGlob().escapePath(
glob = getTinyGlobby().escapePath(
getNormalizePath()(path.resolve(absoluteFrom)),
);

Expand All @@ -397,7 +397,7 @@ class CopyPlugin {
glob = path.isAbsolute(originalFrom)
? originalFrom
: path.posix.join(
getFastGlob().escapePath(
getTinyGlobby().escapePath(
getNormalizePath()(path.resolve(pattern.context)),
),
originalFrom,
Expand Down

0 comments on commit 37253e3

Please sign in to comment.