@@ -52,7 +52,7 @@ function defaultPackageCreator(
5252
5353export default function build (
5454 { sourceDir, artifactsDir, asNeeded= false } : Object ,
55- { manifestData, fileFilter= new FileFilter ( ) ,
55+ { manifestData, fileFilter= new FileFilter ( { filePathsToIgnore : [ path . resolve ( artifactsDir ) ] } ) ,
5656 onSourceChange= defaultSourceWatcher ,
5757 packageCreator= defaultPackageCreator }
5858 : Object = { } ) : Promise {
@@ -95,14 +95,16 @@ export function safeFileName(name: string): string {
9595 */
9696export class FileFilter {
9797 filesToIgnore : Array < string > ;
98-
99- constructor ( { filesToIgnore} : Object = { } ) {
98+ filePathsToIgnore : Array < String > ;
99+ constructor ( { filesToIgnore, filePathsToIgnore } : Object = { } ) {
100100 this . filesToIgnore = filesToIgnore || [
101101 '**/*.xpi' ,
102102 '**/*.zip' ,
103103 '**/.*' , // any hidden file
104- '**/node_modules' ,
104+ '**/node_modules' ,
105105 ] ;
106+
107+ this . filePathsToIgnore = filePathsToIgnore ;
106108 }
107109
108110 /*
@@ -118,6 +120,13 @@ export class FileFilter {
118120 return false ;
119121 }
120122 }
123+ for ( const filePath of this . filePathsToIgnore ) {
124+ if ( filePath === path ) {
125+ log . debug ( `FileFilter: ignoring file ${ path } ` ) ;
126+ return false ;
127+ }
128+ }
121129 return true ;
122- }
130+ }
131+
123132}
0 commit comments