jshttp / cookie

HTTP server cookie parsing and serialization
MIT License
1.36k stars 159 forks source link

Add ESM compatibility #128

Closed benmccann closed 3 years ago

benmccann commented 3 years ago

Closes https://github.com/jshttp/cookie/issues/127

dougwilson commented 3 years ago

Also looks like npm run lint no longer lints the module's source, just the tests.

benmccann commented 3 years ago

Thanks. I rebased against master. Hopefully that fixed the lint issue

I've added a test as well

benmccann commented 3 years ago

I finally got the tests setup to test both the CJS and ESM versions, but it turns out this wrapper approach doesn't work with Vite

benmccann commented 3 years ago

Although that seems to be a Vite bug. It's just ignoring that we're distributing an ESM version and trying to load the CJS version directly, which seems wrong. This PR still seems useful even if Vite is too broken to use it yet