mirror of https://github.com/webpack/webpack.git
fixes #524 again
This commit is contained in:
parent
9a375a770a
commit
6a8caf5cd1
|
|
@ -75,7 +75,7 @@ ContextModuleFactory.prototype.create = function(context, dependency, callback)
|
|||
ContextModuleFactory.prototype.resolveDependencies = function resolveDependencies(fs, resource, recursive, regExp, callback) {
|
||||
(function addDirectory(directory, callback) {
|
||||
fs.readdir(directory, function(err, files) {
|
||||
if(!files || files.length === 0) return callback();
|
||||
if(!files || files.length === 0) return callback(null, []);
|
||||
async.map(files, function(seqment, callback) {
|
||||
|
||||
var subResource = path.join(directory, seqment)
|
||||
|
|
|
|||
|
|
@ -8,4 +8,18 @@ it("should support an empty context", function() {
|
|||
c("");
|
||||
}).should.throw();
|
||||
c.keys().should.be.eql([]);
|
||||
});
|
||||
});
|
||||
|
||||
// This would be a useful testcase, but it requires an (really) empty directory.
|
||||
// **but** you cannot commit empty directories into git
|
||||
/*it("should support an empty context (empty dir)", function() {
|
||||
var c = require.context("./empty", true, /^nothing$/);
|
||||
c.id.should.be.type("number");
|
||||
(function() {
|
||||
c.resolve("");
|
||||
}).should.throw();
|
||||
(function() {
|
||||
c("");
|
||||
}).should.throw();
|
||||
c.keys().should.be.eql([]);
|
||||
});*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue