One way is to write a procedure that would save all the component code to a specified folder on your hard disk and then write a procedure in your source template to import all the exported code, component by component from that same source folder, every time a new document is created based on that template.
Please share the code if you are able to develop it, as it would be quite useful to me. I have not done the same so far, because of shortage of time, since I restrict my programming activities to night (Indiann Stardard Time - IST).