Skip to content

Commit

Permalink
Fix logic to check for missing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed May 26, 2021
1 parent 1db1e16 commit 3e531b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions packages/babel-helper-define-polyfill-provider/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,8 @@ function instantiateProvider<Options>(

const found = missingDependencies.all
? false
: mapGetOr(
depsCache,
`${name} :: ${dirname}`,
() => !deps.has(dirname, name),
: mapGetOr(depsCache, `${name} :: ${dirname}`, () =>
deps.has(dirname, name),
);

if (!found) {
Expand Down
2 changes: 1 addition & 1 deletion test/esm/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function transform(plugin, code = "Array.from(it)") {
return transformSync(code, {
configFile: false,
browserslistConfigFile: false,
plugins: [[plugin, { method: "usage-global" }]],
plugins: [[plugin, { method: "usage-global", missingDependencies: false }]],
}).code;
}

Expand Down

0 comments on commit 3e531b3

Please sign in to comment.