schlosser/pig.js

error using pig.js in an umd environment (angular 9)

BePo65 opened this issue · 1 comments

First thanks for this great project - it solves most of the requirements for a superfast picture list in my current application.

I tried to use pig.js (current master branch - 1e98008) in an angular environment and therefore created a type definition file as angular is a typescript framework.
Whatever I tried, all I got was an error message, stating that typescript couldn't find a constructor.

In the end I had to change line 883 from define([], function() { return Pig; }); to define([], function() { return { Pig }; });.

So I am wondering if this project was ever used in an umd environment (because then I had to go back to my type definition)?
Otherwise (and if this project is still alive) I could create a PR from this if you appreciate that.

A PR would be great! I never tested the UMD environment directly 😅