Skip to content

Commit

Permalink
Prevent false-positive matches
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmyersdev committed Aug 26, 2022
1 parent ce28bab commit e98eb7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
}
},
"scripts": {
"build": "tsc"
"build": "tsc",
"test": "vite build -c test/vite.config.ts"
},
"packageManager": "[email protected]",
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ export const externalizeDeps = (options: Partial<UserOptions> = {}): Plugin => {

if (optionsResolved.deps) {
Object.keys(dependencies).forEach((dep) => {
const depMatcher = new RegExp(`${dep}(?:/.+)?`)
const depMatcher = new RegExp(`^${dep}(?:/.+)?$`)

externalDeps.add(depMatcher)
})
}

if (optionsResolved.peerDeps) {
Object.keys(peerDependencies).forEach((dep) => {
const depMatcher = new RegExp(`${dep}(?:/.+)?`)
const depMatcher = new RegExp(`^${dep}(?:/.+)?$`)

externalDeps.add(depMatcher)
})
Expand Down

0 comments on commit e98eb7e

Please sign in to comment.