Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
feat(kit): add addServerPlugin utility (#8635)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 3, 2022
1 parent 71ecffa commit e450deb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/kit/src/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit e450deb

Please sign in to comment.