Rewrite frontend build script