 # startTime  - Number. Timestamp of a moment when compilation started.
 #
 # Returns Function.
-getCompileFn = (config, joinConfig, fileList, optimizers, watcher, callback) -> (startTime, watcherReady) ->
+getCompileFn = (config, joinConfig, fileList, optimizers, watcher, preCompile, callback) -> (startTime, watcherReady) ->
   assetErrors = fileList.getAssetErrors()
   if assetErrors?
     assetErrors.forEach (error) -> logger.error error

      initWatcher config, (error, watcher) ->
        return callback error if error?
        # Get compile and reload functions.
        compile = getCompileFn config, joinConfig, fileList, optimizers, watcher, callCompileCallbacks
        reload = getReloadFn config, options, onCompile, watcher, server, plugins
        includes = getPluginIncludes(plugins)
        callback error, {


    fileList.initial = false

  if preCompile
    preCompile (error) ->
      if error?
        logger.error error
      else
        fs_utils.write fileList, config, joinConfig, optimizers, startTime, writeCb
  else
    fs_utils.write fileList, config, joinConfig, optimizers, startTime, writeCb

# Generate function that restarts brunch process.
#
