This isn't strictly related to compiling custom export templates, but it's a neat trick to reduce the final distribution size that works regardless of the export template binary used.