ScottHamper / Cookies

JavaScript Client-Side Cookie Manipulation Library
The Unlicense
1.77k stars 170 forks source link

Stop breaking isomorphic apps #64

Closed stutrek closed 7 years ago

stutrek commented 7 years ago

When using webpack this is undefined, and window is undefined on the server. This breaks isomorphic apps. All that needs to be done is to check to see if global is falsy.

I don't know how you make your dist files, so I didn't do any of that.

ScottHamper commented 7 years ago

Thanks, Stu!

stutrek commented 7 years ago

You're welcome! I'd like to say it was for the community, but this PR is a little bit self serving 😄

Can you npm publish the update?

ScottHamper commented 7 years ago

Ha ha, I appreciate the fix regardless, :smile: . It's published now!