Knockout es5 is AMD aware.

In the context of AMD, knockout defines itself as a module and does not attach 'ko' to the global object. This causes es5 to fail.

This change defines an AMD module for es5. Knockout is declared as a dependency to ensure that it loaded first.
This won't work if you have a single file all inside of a function wrapper with require.js.
Since require doesn't directly work with a global object, this piece of code should not either. Simply checking for define as a scoped variable is good enough.

https://github.com/jrburke/r.js/blob/master/build/example.build.js#L476