fix transpilation order for AMD

* requirejs complains about module not found
  if not defined before its usage