Skip to content

Commit

Permalink
ignore node_modules for workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmen committed May 28, 2020
1 parent 23f8a5c commit fd721fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/globber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function createGlobber() {
return {
globPackageFiles(pattern: string) {
return new Promise<Array<string>>((resolve, reject) =>
glob(path.join(pattern, 'package.json'), (err, matches) =>
glob(path.join(pattern, 'package.json'), {ignore: '**/node_modules/**'}, (err, matches) =>
err
? /* istanbul ignore next: errors are for people who don't know what they are doing */
reject(err)
Expand Down
3 changes: 2 additions & 1 deletion src/type-syncer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
} from './util'
import { IGlobber } from './globber'
import { satisfies } from 'semver'
import { resolve,dirname } from 'path'

/**
* Creates a type syncer.
Expand Down Expand Up @@ -61,7 +62,7 @@ export function createTypeSyncer(
[
...ensureWorkspacesArray(file.packages),
...ensureWorkspacesArray(file.workspaces)
].map(globber.globPackageFiles)
].map(path => globber.globPackageFiles(resolve(dirname(filePath), path)))
)
.then(flatten)
.then(uniq)
Expand Down

0 comments on commit fd721fd

Please sign in to comment.