-
Notifications
You must be signed in to change notification settings - Fork 38
Conversation
Yes please. |
function hasRequireHandler(file) { | ||
var fileExt = path.extname(file); | ||
var extensions = Object.keys(require.extensions); | ||
return !!~extensions.indexOf(fileExt); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How's it exclude dotfiles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require.extensions
=== .js
or .node
or .json
(unless mutated).
The only time a dotfile will be included is if it's one of those files which, I would argue, is weird but appropriate behavior.
EDIT: as you mentioned in chat, .words.js
will also be included. True. Do we want to exclude that behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just seems odd. I'd expect auto-loading to ignore dotfiles, even if they're .thing.js
. Less weird if explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just like foo/*
on the shell doesn't include foo/.*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But parsing files in a dir in node does. Which behavior should we emulate (shell or node)? As mentioned, I could see either way so looking for feedback.
Updated. Will not traverse into dot directories and will ignore dot files. How we liking this behavior? |
Squash the three implementation commits together? |
Is there any good reason to make this backward compatible -- opt in, perhaps? |
Bonus points for partyscript! |
partyscript is its own bonus. |
👍 unless it can be made backward compatible without making it horrible. |
I think this is a fundamentally backward incompatible change. Again, unlikely to break things in the real world, but non-backward compatible nonetheless. |
Closes #58 |
Closes #46 |
Fixes the directory crawler to properly ignore not requirable files (including dotfiles).