Current behaviour serialises them straight into the JS file. Another option, which should be opt-in, could be to create a separate JS class for every found version of the generic class.
E.g. new Generic<string>() and new Generic<int>() could create Generic_string.js and Generic_int.js