Skip to content

Commit

Permalink
refactor: change createExternalResolver to makeExternalPredicate
Browse files Browse the repository at this point in the history
  • Loading branch information
wellyshen committed Oct 15, 2020
1 parent e1c8398 commit fc9940e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rollup/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const isDemo = BUILD === "demo";
const isDist = BUILD === "full" || BUILD === "pure";
let src = "src";

const createExternalResolver = (external) =>
const makeExternalPredicate = (external) =>
!external.length
? () => false
: (id) => new RegExp(`^(${external.join("|")})($|/)`).test(id);
Expand Down Expand Up @@ -89,7 +89,7 @@ export default {
output: isDist ? [cjs, esm] : [cjs],
plugins,
external: isDist
? createExternalResolver([
? makeExternalPredicate([
...Object.keys(pkg.peerDependencies),
...Object.keys(pkg.dependencies),
])
Expand Down

0 comments on commit fc9940e

Please sign in to comment.