Skip to content

Commit

Permalink
Merge pull request #55 from storybooks/fix-regexp-test
Browse files Browse the repository at this point in the history
Should test the './' part as well
  • Loading branch information
roonyh authored Nov 7, 2016
2 parents 64f2c38 + bbb3a21 commit 7502810
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/require_context.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ function requireModules(keys, root, directory, regExp, recursive) {
const files = fs.readdirSync(path.join(root, directory));

files.forEach((filename) => {
if (regExp.test(path.join(directory, filename))) {
// webpack adds a './' to the begining of the key
// TODO: Check this in windows
const entryKey = `./${path.join(directory, filename)}`;
// webpack adds a './' to the begining of the key
// TODO: Check this in windows
const entryKey = `./${path.join(directory, filename)}`;
if (regExp.test(entryKey)) {
// eslint-disable-next-line no-param-reassign, global-require, import/no-dynamic-require
keys[entryKey] = require(path.join(root, directory, filename));
return;
Expand Down

0 comments on commit 7502810

Please sign in to comment.