I have the following code in a for loop which combines 16 js files. What happens is that I want to lazy load these 16 files instead of doing it this way. Can someone tell me how to accomplish this. The reason I want to lazy load is because I have a file size limit that I do not want to exceed and I believe lazy load will prevent my file from exceeding a certain size threshold.
for (var n = 1; n < 17; n++) {
var trees = require('./code_files/' + n + '.js');
for (var i = 0; i < trees.length; i++) {
classes[trees[i](features)]++;
}