We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c6293b commit 6937e76Copy full SHA for 6937e76
src/utils.js
@@ -18,7 +18,15 @@ export function createDynamicImportTransform({ template, types: t }) {
18
const buildImport = template('Promise.resolve(SOURCE).then(s => INTEROP(require(s)))');
19
const buildImportNoInterop = template('Promise.resolve(SOURCE).then(s => require(s))');
20
21
+ const visited = typeof WeakSet === 'function' && new WeakSet();
22
+
23
return (context, path) => {
24
+ if (visited) {
25
+ if (visited.has(path)) {
26
+ return;
27
+ }
28
+ visited.add(path);
29
30
const SOURCE = getImportSource(t, path.parent);
31
32
const newImport = context.opts.noInterop
0 commit comments