Skip to content

Commit

Permalink
fix: subdirectory errors in blob patterns
Browse files Browse the repository at this point in the history
Related-to: #52
  • Loading branch information
kevlened authored and joshwiens committed Sep 29, 2017
1 parent 91b9022 commit c2720d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/writeFileToAssets.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ export default (opts) => {
.statAsync(absFileSrc)
.then((stat) => {

// We don't write empty directories
if (stat.isDirectory()) {
return;
}

function addToAssets() {
compilation.assets[relFileDest] = {
size () {
Expand Down
12 changes: 6 additions & 6 deletions tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ describe('apply function', () => {
'directory/nested/nestedfile.txt'
],
patterns: [{
from: '**/*.txt'
from: '**/*'
}]
})
.then(done)
Expand All @@ -250,7 +250,7 @@ describe('apply function', () => {
'nested/directory/nested/nestedfile.txt'
],
patterns: [{
from: '**/*.txt',
from: '**/*',
to: 'nested'
}]
})
Expand All @@ -266,7 +266,7 @@ describe('apply function', () => {
],
patterns: [{
context: 'directory',
from: '**/*.txt',
from: '**/*',
to: 'nested'
}]
})
Expand All @@ -283,7 +283,7 @@ describe('apply function', () => {
patterns: [{
context: 'directory',
flatten: true,
from: '**/*.txt',
from: '**/*',
to: 'nested'
}]
})
Expand All @@ -299,7 +299,7 @@ describe('apply function', () => {
],
patterns: [{
context: path.join(HELPER_DIR, 'directory'),
from: '**/*.txt',
from: '**/*',
to: 'nested'
}]
})
Expand Down Expand Up @@ -587,7 +587,7 @@ describe('apply function', () => {
'directory/nested/nestedfile.txt'
],
patterns: [{
from: '**/*.txt',
from: '**/*',
ignore: [
'file.*'
]
Expand Down

0 comments on commit c2720d0

Please sign in to comment.