A method of forming a waveguide or an optical assembly includes molding a waveguide material, optionally in alignment with one or more optical components. The one or more optical components are aligned in a precision mold that is also used to form the waveguide. A cladding and encapsulation material can also be molded. The molded materials can be used to hold the components together in alignment in a single assembly. A connector structure can be molded as part of the assembly or can be prefabricated and incorporated into the molded assembly to facilitate connecting the assembly to other components without requiring active alignment or polishing of optical fiber ends.