mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
docs: describe env
object for nuxt plugins (#22963)
This commit is contained in:
parent
d49ea58de0
commit
d28189eb58
@ -61,6 +61,12 @@ export default defineNuxtPlugin({
|
||||
})
|
||||
```
|
||||
|
||||
You can also use the `env` property to define the environments in which your plugin will run.
|
||||
|
||||
- **islands**
|
||||
- **default**: `true`
|
||||
- **description**: You can set this value to `false` if you don't want the plugin to run when rendering server-only or island components.
|
||||
|
||||
::alert
|
||||
If you are using an object-syntax plugin, the properties may be statically analyzed in future to produce a more optimized build. So you should not define them at runtime. For example, setting `enforce: process.server ? 'pre' : 'post'` would defeat any future optimization Nuxt is able to do for your plugins.
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user