Windows uses \ as its path separator by default, so anything passed through the native node.js path methods spits out an unexpectedly backslashy string. Luckily we can get around this problem by being as slash-nostic as possible. There were two basic steps in the final solution:
Escape backslashes before passing strings to the RegExp constructor
Convert file paths returned by glob into the appropriate OS-specific path (read: convert / to path.sep)
Windows uses
\
as its path separator by default, so anything passed through the native node.jspath
methods spits out an unexpectedly backslashy string. Luckily we can get around this problem by being as slash-nostic as possible. There were two basic steps in the final solution:RegExp
constructorglob
into the appropriate OS-specific path (read: convert/
topath.sep
)