timlrx / contentlayer2

Contentlayer turns your content into data - making it super easy to import MD(X) and CMS content in your app
https://contentlayer.dev
MIT License
153 stars 11 forks source link

Use import attributes rather than json assertions #24

Closed lishaduck closed 2 months ago

lishaduck commented 2 months ago

A quick fix from #21. Not going to mark it as closed as I didn't test it, but it should fix it.

timlrx commented 2 months ago

Thanks for starting the fix. There's an additional consideration - import attributes is only supported from node v18.20 and node v20.10 onwards.

This means the package would probably need to support both versions. Will create a branch of this to handle the different conditions. I was also considering dropping support for Node 16 since it is now EOL, so this seems like a good chance to do so.