For UE4.x ONLY there’s another trick, not as easy as adding dummy cpp files but if you insist of not adding files manully…
first create an dummy blueprint.
now,
On Project Settings → Packaging → Blueprints →
set Blueprint Nativization Method to Exclusive.
next add the empty blueprint to the List of blueprint assets to nativize.
it will nativize your empty pb to empty cpp files which in turn force project compilation and therefor plugin compilation.
UE5 has dropped this feature so the only possibility as of now seems like adding dummy cpp files at stated above.