 
     fileList.initial = false
 
-  fs_utils.write fileList, config, joinConfig, optimizers, startTime, writeCb
+  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.
 #

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


      # Does the user's config say this plugin should definitely be used?
      return true if plugin.brunchPluginName in alwaysEnabled

      # If the plugin is an optimizer that doesn't specify a defaultEnv
      # decide based on the config.optimize setting
      return config.optimize if plugin.optimize and not plugin.defaultEnv

      # Use plugin-specified defaultEnv or assume it's meant for any env
      env = plugin.defaultEnv ?= '*'

      # Finally, is it meant for either any environment or an active environment?
      env is '*' or env in config.env

