Ensure that all imports and exports are read before rewriting.