Removes unecessary files from publication and adds dependencies.