Generate main.js also for optimization. Javadoc