The present invention relates to a method for incorporating dye and/or nanoparticles into polymer films and into electrospun polymeric nanofibers, and, more specifically, to a method for electrospinning a molecularly homogenous solution of dye (and/or nanoparticles) and polymer dissolved in a mutual solvent leading to uniform distribution of dye across the cross-section of each constituent fiber and to resulting nanofibers with the dye/nanoparticles incorporated therein.