Skip to content

Commit a563f53

Browse files
committed
Merge pull request #53 from kevlened/subdirectory-blobs
Fix subdirectory errors in blob patterns
2 parents 544587b + 3b1a451 commit a563f53

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.0.1 (May 29, 2016)
2+
3+
* Fix error thrown when subdirectories are in glob results
4+
15
## 3.0.0 (May 14, 2016)
26

37
BREAKING CHANGE

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "copy-webpack-plugin",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"description": "Copy files and directories in webpack",
55
"main": "dist/index.js",
66
"repository": {

src/writeFileToAssets.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ export default (opts) => {
2525
.statAsync(absFileSrc)
2626
.then((stat) => {
2727

28+
// We don't write empty directories
29+
if (stat.isDirectory()) {
30+
return;
31+
}
32+
2833
function addToAssets() {
2934
compilation.assets[relFileDest] = {
3035
size () {

tests/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ describe('apply function', () => {
235235
'directory/nested/nestedfile.txt'
236236
],
237237
patterns: [{
238-
from: '**/*.txt'
238+
from: '**/*'
239239
}]
240240
})
241241
.then(done)
@@ -250,7 +250,7 @@ describe('apply function', () => {
250250
'nested/directory/nested/nestedfile.txt'
251251
],
252252
patterns: [{
253-
from: '**/*.txt',
253+
from: '**/*',
254254
to: 'nested'
255255
}]
256256
})
@@ -266,7 +266,7 @@ describe('apply function', () => {
266266
],
267267
patterns: [{
268268
context: 'directory',
269-
from: '**/*.txt',
269+
from: '**/*',
270270
to: 'nested'
271271
}]
272272
})
@@ -283,7 +283,7 @@ describe('apply function', () => {
283283
patterns: [{
284284
context: 'directory',
285285
flatten: true,
286-
from: '**/*.txt',
286+
from: '**/*',
287287
to: 'nested'
288288
}]
289289
})
@@ -299,7 +299,7 @@ describe('apply function', () => {
299299
],
300300
patterns: [{
301301
context: path.join(HELPER_DIR, 'directory'),
302-
from: '**/*.txt',
302+
from: '**/*',
303303
to: 'nested'
304304
}]
305305
})
@@ -587,7 +587,7 @@ describe('apply function', () => {
587587
'directory/nested/nestedfile.txt'
588588
],
589589
patterns: [{
590-
from: '**/*.txt',
590+
from: '**/*',
591591
ignore: [
592592
'file.*'
593593
]

0 commit comments

Comments
 (0)