Retain list of imported modules in JS