Skip to content

Commit c2720d0

Browse files
kevlenedjoshwiens
authored andcommitted
fix: subdirectory errors in blob patterns
Related-to: #52
1 parent 91b9022 commit c2720d0

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

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)