WOW
WOW copied to clipboard
AMD and CommonJS support
Would be sweet with AMD and CommonJS support for Browserify :) The UMD method is nice https://github.com/umdjs/umd
+1
:+1:
I also prefer the UDM way. If anyone's up for some coding, PRs are welcome as always.
I found this sample code in a french post that seems to be universal. http://putaindecode.fr/posts/js/browserify-all-the-things/#ecrire-un-module-pour-browserify-mais-pas-que
+1
Could you please try the amd branch and see if that works for you? If yes, we could merge that.
Hi @attilaolah, the amd branch is working for me with one exception. When using browserify, the global this
object is not equal to window
, so the browser function checks for MutationObserver and WeakMap fail. Would it be possible to explicitly reference the window
object in those places?
Yes, we can do that (explicitly reference window
).
I am not entirely sure how relevant the following is regarding the present issue, but here is how I used browserify-shim to get wow work with browserify, in case somebody lands here looking for help:
$ npm install -D browserify browserify-shim wow.js
package.json append:
"browserify": {
"transform": [ "browserify-shim" ]
},
"browser": {
"wow": "./node_modules/wow.js/dist/wow.js"
},
"browserify-shim": {
"wow": {"exports": "WOW"}
}
index.js:
var WOW = require('wow');
new WOW().init();
To echo what @pcavanaugh said, to get WOW working with Browserify, I had to download the AMD branch, then change a few this
s to window
to get it to work.
I can confirm what @Wtower posted with no need to do an extra steps. Using Gulp to compile this project.