File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ A pattern looks like:
4545 - defaults to ` false `
4646 - removes all directory references and only copies file names
4747 - if files have the same name, the result is non-deterministic
48+ * ` ignore `
49+ - additional globs to ignore for this pattern
4850
4951#### Available options:
5052* ` ignore `
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export default (patterns = [], options = {}) => {
4343 const outputPath = getOutputDir ( compiler ) ;
4444 const fileDependencies = [ ] ;
4545 const contextDependencies = [ ] ;
46- const ignoreList = options . ignore ;
46+ const webpackIgnore = options . ignore || [ ] ;
4747 const copyUnmodified = options . copyUnmodified ;
4848 let writtenAssets ;
4949 let lastGlobalUpdate ;
@@ -57,6 +57,7 @@ export default (patterns = [], options = {}) => {
5757 let relDest ;
5858 let globOpts ;
5959 let context ;
60+ const ignoreList = webpackIgnore . concat ( pattern . ignore || [ ] ) ;
6061
6162 if ( pattern . context && ! path . isAbsolute ( pattern . context ) ) {
6263 pattern . context = path . resolve ( webpackContext , pattern . context ) ;
Original file line number Diff line number Diff line change @@ -578,6 +578,23 @@ describe('apply function', () => {
578578 . then ( done )
579579 . catch ( done ) ;
580580 } ) ;
581+
582+ it ( 'ignores files in pattern' , ( done ) => {
583+ runEmit ( {
584+ expectedAssetKeys : [
585+ 'directory/directoryfile.txt' ,
586+ 'directory/nested/nestedfile.txt'
587+ ] ,
588+ patterns : [ {
589+ from : '**/*.txt' ,
590+ ignore : [
591+ 'file.*'
592+ ]
593+ } ]
594+ } )
595+ . then ( done )
596+ . catch ( done ) ;
597+ } ) ;
581598 } ) ;
582599
583600 describe ( 'with directory in from' , ( ) => {
You can’t perform that action at this time.
0 commit comments