File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -56,14 +56,13 @@ export default (patterns = [], options = {}) => {
5656 Promise . each ( patterns , ( pattern ) => {
5757 let relDest ;
5858 let globOpts ;
59- let context ;
60- const ignoreList = webpackIgnore . concat ( pattern . ignore || [ ] ) ;
6159
6260 if ( pattern . context && ! path . isAbsolute ( pattern . context ) ) {
6361 pattern . context = path . resolve ( webpackContext , pattern . context ) ;
6462 }
65-
66- context = pattern . context || webpackContext ;
63+
64+ const context = pattern . context || webpackContext ;
65+ const ignoreList = webpackIgnore . concat ( pattern . ignore || [ ] ) ;
6766
6867 globOpts = {
6968 cwd : context
@@ -112,8 +111,11 @@ export default (patterns = [], options = {}) => {
112111 }
113112
114113 return globAsync ( relSrc , globOpts )
115- . each ( ( relFileSrc ) => {
114+ . each ( ( relFileSrcParam ) => {
116115 let relFileDest ;
116+ let relFileSrc ;
117+
118+ relFileSrc = relFileSrcParam ;
117119
118120 // Skip if it matches any of our ignore list
119121 if ( shouldIgnore ( relFileSrc , ignoreList ) ) {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export default (opts) => {
2020 return fs
2121 . statAsync ( absFileSrc )
2222 . then ( ( stat ) => {
23- if ( ! copyUnmodified && stat . mtime . getTime ( ) < lastGlobalUpdate ) {
23+ if ( stat . isDirectory ( ) || ! copyUnmodified && stat . mtime . getTime ( ) < lastGlobalUpdate ) {
2424 return null ;
2525 }
2626
Original file line number Diff line number Diff line change @@ -281,9 +281,9 @@ describe('apply function', () => {
281281 ] ,
282282 patterns : [ {
283283 context : 'directory' ,
284+ flatten : true ,
284285 from : '**/*.txt' ,
285- to : 'nested' ,
286- flatten : true
286+ to : 'nested'
287287 } ]
288288 } )
289289 . then ( done )
@@ -665,9 +665,9 @@ describe('apply function', () => {
665665 'newdirectory/nestedfile.txt'
666666 ] ,
667667 patterns : [ {
668+ flatten : true ,
668669 from : 'directory' ,
669- to : 'newdirectory' ,
670- flatten : true
670+ to : 'newdirectory'
671671 } ]
672672 } )
673673 . then ( done )
You can’t perform that action at this time.
0 commit comments