MichalZalecki / storage-factory

Because using localStorage directly is a bad idea
https://www.npmjs.com/package/storage-factory
63 stars 5 forks source link

Vite compatibility #29

Open micah-redwood opened 1 year ago

micah-redwood commented 1 year ago

First off, thanks for this really helpful library. Great to have a bullet-proof import vs having to write try-catch statements myself.

I noticed that the package is currently incompatible with Vite. To replicate, just setup a new Vite project (Vite 3 or Vite 4, breaks in both), import the package, and run npm run dev (which runs vite command for HMR)

image

I'm guessing it has something to do with how this package is bundled for npm.

Any ideas? Thanks!

etiennea commented 1 year ago

Made a PR for compatibility