johnkpaul/requireify — pull request #9 by topcloud (2014-01-11 09:39:36+00:00)
Title: Made require paths system-independent. Backslashes and forwardslashes ca...

...n now be used interchangibly.

Basically, in Windows, it forced me to use backslashes \ to require scripts located in subdirectories - But if I ran the same code in linux, it would expect forwardslases - Basically it wouldn't find scripts which were in subdirectories if I used the wrong kinds of slashes for my system.

This patch normalizes all paths to use linux-style forwardslashes so this doesn't happen.

Note that I originally wanted to use a normalizePath() function to do the conversion (instead of doing the regex replace inline) but the innersource() module which stringifies functions for client-side use didn't like that (it couldn't find the normalizePath function once run in the browser).