browserify-window-context
Adds Window context to shimed module
By default in a shimed module this
points to empty Object
that makes a lot of non-CommonJS modules fail. This browserify transformation replaces this
with Window
and script runs as expected.
package.json
Installation
npm install browserify-window-context
How it works
It simply wraps your script with another function and applies new window
context like so:
(function () {' + data + '}).apply(window);
Setup
Add alias of your script to browser
:
"browser": ,
Then add alias of your script to browserify-window-context
:
"browserify-window-context": ,