root variable is determined based on existence of exports and alternatively defaults to this which when used with <script/> is window... However if the module is packaged with any tool like browserify, this context ends up being some king of define function used to package files instead of window.
It feels that root should always be window. Also, I would like to optimize some variable references like root.document which don't get minified right now.
root
variable is determined based on existence ofexports
and alternatively defaults tothis
which when used with<script/>
iswindow
... However if the module is packaged with any tool like browserify,this
context ends up being some king ofdefine
function used to package files instead ofwindow
.It feels that
root
should always bewindow
. Also, I would like to optimize some variable references likeroot.document
which don't get minified right now.Thoughts?