Clean directories at build() instead of write()