Please sign in to comment.
Holy grail achieved! Robust require hooking!
The premise is simple: whenever we call the underlying require handler to load and execute a file, we immediately after verify if our hooks are still there. If not, they got overwritten, so we can simply update them. The test server works like a charm now! As a side benefit, this also expands the watching to support any and all file extensions, not just .js and .coffee! Because we simply check all registered extension handlers, and hook into any that we haven't already hooked into. Suh-weet!
- Loading branch information...