nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.08k stars 624 forks source link

fix: opt in to `import.meta.*` properties #2597

Closed danielroe closed 6 months ago

danielroe commented 6 months ago

🔗 Linked issue

❓ Type of change

📚 Description

This is a very early PR to make this module compatible with changes we expect to release in Nuxt v5.

In Nuxt v3.7.0 we added support for import.meta.* (see original PR) and we've been gradually updating docs and moving across from the old process.* patterned variables.

As I'm sure you're aware, these variables are replaced at build-time and enable tree-shaking in bundled code. This change affects runtime code (that is, that is processed by the Nuxt bundler, like vite or webpack) rather than code running in Node. So it really doesn't matter what the string is, but it makes more sense in an ESM-world to use import.meta rather than process.

(It might be worth updating the module compatibility as well to indicate it needs to have Nuxt v3.7.0+, but I'll leave that with you if you think this is a good approach.)

📝 Checklist

cloudflare-workers-and-pages[bot] commented 6 months ago

Deploying nuxt-content with  Cloudflare Pages  Cloudflare Pages

Latest commit: ec09080
Status: ✅  Deploy successful!
Preview URL: https://95156e8d.nuxt-content-1il.pages.dev
Branch Preview URL: https://process-client.nuxt-content-1il.pages.dev

View logs