Skip to content

Commit

Permalink
chore(dynamic-import-vars): revert 2.1.4 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape committed Oct 21, 2024
1 parent 0f45234 commit 8686cec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 30 deletions.
4 changes: 2 additions & 2 deletions packages/dynamic-import-vars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
"@rollup/pluginutils": "^5.0.1",
"astring": "^1.8.5",
"estree-walker": "^2.0.2",
"magic-string": "^0.30.3",
"tinyglobby": "^0.2.8"
"fast-glob": "^3.2.12",
"magic-string": "^0.30.3"
},
"devDependencies": {
"acorn": "^8.8.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/dynamic-import-vars/src/dynamic-import-to-glob.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import { escapePath } from 'tinyglobby';
import fastGlob from 'fast-glob';

export class VariableDynamicImportError extends Error {}

Expand All @@ -12,7 +12,7 @@ function sanitizeString(str) {
if (str.includes('*')) {
throw new VariableDynamicImportError('A dynamic import cannot contain * characters.');
}
return escapePath(str);
return fastGlob.escapePath(str);
}

function templateLiteralToGlob(node) {
Expand Down
4 changes: 2 additions & 2 deletions packages/dynamic-import-vars/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from 'path';

import { walk } from 'estree-walker';
import MagicString from 'magic-string';
import { globSync } from 'tinyglobby';
import fastGlob from 'fast-glob';
import { generate } from 'astring';

import { createFilter } from '@rollup/pluginutils';
Expand Down Expand Up @@ -50,7 +50,7 @@ function dynamicImportVariables({ include, exclude, warnOnError, errorWhenNoFile
}

// execute the glob
const result = globSync(glob, { cwd: path.dirname(id), expandDirectories: false });
const result = fastGlob.sync(glob, { cwd: path.dirname(id) });
const paths = result.map((r) =>
r.startsWith('./') || r.startsWith('../') ? r : `./${r}`
);
Expand Down
27 changes: 3 additions & 24 deletions pnpm-lock.yaml

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

0 comments on commit 8686cec

Please sign in to comment.