With Pakistan they have already done so. Advanced nuclear weapons with advanced missile technology. Once the J-20 is in full service with PLAAF it's only a matter of time before Pakistan receives them. Especially in light of the fact that the Chinese want to protect their vital assets in Gwadar and throughout the CPEC route.
Well, its good you are positive in that matter, but lets talk the present situation.
1. Why taking Rafale as threat, because they are more likely be deployed in the eastern front.
2. IAF have already lead, and the weapons are more superior, and in numbers.
3. J-20 is not cleared for export, nor it is ready right now. J-31 which is build by china for export in mind will take a decade.
4. If Chinese want to protect their vital assets in Gwadar and throughout the CPEC, than they should deploy long range SAM HQ-9 in Gwadar, than J-20.
Any way lets be realistic. In the present situation, If you take my view, than Pakistan should sit with China and Russia, and discuss seriously about the J-10B. If Pakistan is satisfied with the present Chinese WS-xx engine, than induct J-10B, and if not that make the deal with the Russian, with full MRO facilities, and spares depot in Pakistan.
Second, coustomised the J-10B with the Pakistani requirement, either from the Chinese, or the Western Avionics, and LRU's which ever gives better advantage. Increase the Air Defence, and make them stronger and the idea should be to create the Area Denial over the Pakistani Airspace.