@@ -2,14 +2,15 @@ import { ProjectGraph } from '../project-graph';
22import { NxJson } from '../shared-interfaces' ;
33import { Task } from '../../tasks-runner/tasks-runner' ;
44import { readFileSync } from 'fs' ;
5- import { rootWorkspaceFileNames } from '../file-utils' ;
5+ import { getIgnoredGlobs , rootWorkspaceFileNames } from '../file-utils' ;
66import { execSync } from 'child_process' ;
77import {
88 defaultFileHasher ,
99 extractNameAndVersion ,
1010 FileHasher ,
1111} from './file-hasher' ;
1212import { defaultHashing , HashingImp } from './hashing-impl' ;
13+ import { Ignore } from 'ignore' ;
1314
1415const resolve = require ( 'resolve' ) ;
1516
@@ -50,12 +51,14 @@ export class Hasher {
5051 private fileHasher : FileHasher ;
5152 private projectHashes : ProjectHasher ;
5253 private hashing : HashingImp ;
54+ private ignore : Ignore ;
5355
5456 constructor (
5557 private readonly projectGraph : ProjectGraph ,
5658 private readonly nxJson : NxJson ,
5759 private readonly options : any ,
58- hashing : HashingImp = undefined
60+ hashing : HashingImp = undefined ,
61+ ignore : Ignore = getIgnoredGlobs ( )
5962 ) {
6063 if ( ! hashing ) {
6164 this . hashing = defaultHashing ;
@@ -69,6 +72,7 @@ export class Hasher {
6972 this . fileHasher ,
7073 this . hashing
7174 ) ;
75+ this . ignore = ignore ;
7276 }
7377
7478 async hashTasks ( tasks : Task [ ] ) : Promise < Hash [ ] > {
@@ -153,7 +157,7 @@ export class Hasher {
153157
154158 const fileNames = [
155159 ...Object . keys ( this . nxJson . implicitDependencies || { } ) ,
156- ...rootWorkspaceFileNames ( ) ,
160+ ...rootWorkspaceFileNames ( ) . filter ( ( name ) => ! this . ignore . ignores ( name ) ) ,
157161 'package-lock.json' ,
158162 'yarn.lock' ,
159163 ] ;
0 commit comments