mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +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)
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user