Compile main JS with updated modal handling