mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-01 18:07:22 +00:00
feat(kit): add addServerPlugin
utility (#8635)
This commit is contained in:
parent
71ecffa234
commit
e450debc08
@ -32,6 +32,15 @@ export function addDevServerHandler (handler: NitroDevEventHandler) {
|
|||||||
useNuxt().options.devServerHandlers.push(handler)
|
useNuxt().options.devServerHandlers.push(handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a Nitro plugin
|
||||||
|
*/
|
||||||
|
export function addServerPlugin (plugin: string) {
|
||||||
|
const nuxt = useNuxt()
|
||||||
|
nuxt.options.nitro.plugins = nuxt.options.nitro.plugins || []
|
||||||
|
nuxt.options.nitro.plugins.push(normalize(plugin))
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Access to the Nitro instance
|
* Access to the Nitro instance
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user