The Environment matters!
... read the whole story at prepack.io.
Out of the box, Prepack does not fully model a browser or node.js environment: Prepack has no built-in knowledge of
window. In fact, when prepacking code which references such properties, they will evaluate to
undefined. You would have to insert a model of the relevant functionality at the beginning of the code you want to prepack.
The following helper functions aid in writing models.