   info = fillDefaults overrides, defaults
 
   # Load hooked event handlers, if any.
-  for hook, module of info.hooks
-    info.hooks[hook] = require path.resolve(module) if module?
+  info.hookFns = {}
+  for hook, module of info.hooks when module?
+    info.hooks[hook] = file = path.resolve module
+    info.hookFns[hook] = require file
 
   # Set source and target paths.
   overrides.paths = {src: 'lib'} unless overrides.paths?


  # Run lexer and its hook.
  tryWithFile file, 'tokenizing', -> src = coffee.tokens src
  src = info.hooks.tokenize(target, src) if info.hooks.tokenize?

  # Run parser and its hook.
  tryWithFile file, 'parsing', -> src = coffee.nodes src
  src = info.hooks.parse(target, src) if info.hooks.parse?

  # Run compiler and its hook.
  tryWithFile file, 'compiling', -> src = src.compile bare: true
  src = info.hooks.compile(target, src) if info.hooks.compile?

  # Write compiled source to target file.
  makeDir path.dirname(target)

docs = ->
  info = loadInfo()
  paths = (path.join(pth, '**/*.coffee') for pth of info.paths)
  paths.push pth + '.{coffee,js}' for _, pth of info.hooks when pth
  console.log paths
  withFiles "{#{paths.join()}}", (files) ->
    tryExec('docco', '"' + files.join('" "') + '"')

