fixed requirejs and build optimisation problems