nuxt icon indicating copy to clipboard operation
nuxt copied to clipboard

Add import meta for static rendering

Open Barbapapazes opened this issue 1 year ago • 4 comments
trafficstars

Describe the feature

Hello,

Actually, there is different import meta. One of them is for prerendering. But there is nothing about static when nuxt is generating the website. Pre-render key is not enough specific when site is static since there is a payload generated.

See https://github.com/nuxt/content/issues/2533

https://nuxt.com/docs/api/advanced/import-meta#runtime-app-properties

Additional information

  • [ ] Would you be willing to help implement this feature?
  • [ ] Could this feature be implemented as a module?

Final checks

Barbapapazes avatar Feb 01 '24 11:02 Barbapapazes

Modules can use nuxt.options.static flag to change their behavior for full-static builds.

pi0 avatar Feb 01 '24 11:02 pi0

And is this usable in a composable? (not in a module.ts file).

Barbapapazes avatar Feb 01 '24 13:02 Barbapapazes

The nuxt options are only usable in nuxt/module context but modules can expose whatever they need at runtime.

danielroe avatar Feb 01 '24 19:02 danielroe

What would your use case be for this?

danielroe avatar Feb 09 '24 10:02 danielroe

Closing as I think this is already implemented. Feel free to add more info later and we can reopen 🙏

danielroe avatar May 10 '24 09:05 danielroe