       .then(compile_or_pass)
       .then (o) =>
         @content = o.result
-        @sourcemap = o.sourcemap
-        return @content
+        res = { result: @content }
+        if o.sourcemap
+          @sourcemap = o.sourcemap
+          res.sourcemap = @sourcemap
+        return res
       .tap(=> sequence(hooks('compile_hooks.after_pass'), @))
 
   ###*

      .then((o) => @content = o)
      .then(=> sequence(hooks('compile_hooks.before_file'), @))
      .then(each_pass)
      .tap((o) => @content = o)
      .tap(=> @roots.emit('compile', @file))
      .then(=> sequence(hooks('compile_hooks.after_file'), @))
      .then(write_file)


  each_pass = ->
    pass = new CompilePass(@)
    pipeline(@adapters.map((a,i) -> pass.run.bind(pass, a, i + 1)), { result: @content })

  ###*
   * Returns the absolute path to the file as requested through the browser,
