universal-zopfli-js
universal-zopfli-js copied to clipboard
Possible to get this to work in browsers?
Hey,
I'm looking to get zopfli to work in a browser environment. I played around a little bit with the makefile in this project, but couldn't get it to work since I'm pretty new to web assembly. Have you tried to make a browser friendly build? Is it possible to do? (I'm not necessarily saying you should include it in the package)
Cheers
I think it works on browsers if they have WebAssembly support, although I have not yet tried it.
Will add tests on browsers later, but you can give it a try with webpack or something.
I was able to get this working in the browser, but not with my bundler. This was because libzopfli.js didn't export itself when ENVIRONMENT_IS_WEB is true.
I patched this in the project I was working on, but I'm sure there's a cleaner way.