The short version is that:
- Asana uses an internal module system that uses
module.exports
andrequire
- the CommonJS standard you may know from node.js. - The
knockout.js
file checks the environment to determine if it should be settingwindow.ko
or usingmodule.exports
or AMD-styledefine
. If it detects CommonJS-stylerequire
it sets properties onexports
instead of on a globalko
object.
Workaround:
You could temporarily "copy" require off first:
_require = require; require = null
And then it should set window.ko
as you're expecting!