   ## Resolution
 
   defp update_stale_sources(sources, removed, changed) do
+    # Remove delete sources
     sources =
-      Enum.reject(sources, fn source(source: source) -> source in removed end)
+      Enum.reduce(removed, sources, &List.keydelete(&2, &1, source(:source)))
+    # Store empty sources for the changed ones as the compiler appends data
     sources =
       Enum.reduce(changed, sources, &List.keystore(&2, &1, source(:source), source(source: &1)))
     sources

        module: module,
        kind: kind,
        source: source,
        beam: beam,
        binary: binary
      )


    File.mkdir_p!(Path.dirname(manifest))

    modules =
      for module(binary: binary, module: module) = entry <- modules do
        beam = Atom.to_string(module) <> ".beam"
        if binary do
          beam_path = Path.join(compile_path, beam)
          File.write!(beam_path, binary)
          File.touch!(beam_path, timestamp)
        end
        module(entry, binary: nil, beam: beam)
      end

    manifest_data =
