add preinstall script to compile dist