dist resource recursively implement