write a package.json
Allow for window not to exist.

This disgusting hack is not tested.