HOW DO I ACCESS THE WINDOW OBJECT FROM A REQUIRED FILE'S SCOPE?

Posts

Pages: 1
I have one of my modules in a separate js file, and it needs access to the window object to do its thing. For some reason, the require() function puts it in a scope where it can't simply do that by default.

How do I get around that limitation without injecting the window from outside?
You are not supposed to - a module is self-contained, so please do inject the window object from outside when you need it.
Pages: 1