Imrpoved requirejs insertion to prevent uesless code in built result