jlouthan / perspective-transform

A small JavaScript library for creating and applying perspective transforms
MIT License
182 stars 29 forks source link

'this' is undefined when requiring the package #7

Open danielgranat opened 2 years ago

danielgranat commented 2 years ago

Hi, I had some issue with 'this' being undefined when loading the file using parcel. I think it has to do with the following:

"The this keyword could be used inside functions running in non–strict mode, but this will be undefined in Modules and inside functions running in strict mode. "

See here- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#description

This solved my issue.

fifzteen commented 1 year ago

same issue on esbuild. I hope this nice PR to be pulled:)