Split JS to client/server files