mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
feat(nuxt): add nitro:build:public-assets
hook (#19638)
This commit is contained in:
parent
88a5f38de0
commit
9d850a2a12
@ -60,6 +60,7 @@ Hook | Arguments | Description
|
||||
`nitro:config` | `nitroConfig` | Called before initializing Nitro, allowing customization of Nitro's configuration.
|
||||
`nitro:init` | `nitro` | Called after Nitro is initialized, which allows registering Nitro hooks and interacting directly with Nitro.
|
||||
`nitro:build:before` | `nitro` | Called before building the Nitro instance.
|
||||
`nitro:build:public-assets` | `nitro` | Called after copying public assets. Allows modifying public assets before Nitro server is built.
|
||||
`prerender:routes` | `ctx` | Allows extending the routes to be pre-rendered.
|
||||
`build:error` | `error` | Called when an error occurs at build time.
|
||||
`prepare:types` | `options` | Called before Nuxi writes `.nuxt/tsconfig.json` and `.nuxt/nuxt.d.ts`, allowing addition of custom references and declarations in `nuxt.d.ts`, or directly modifying the options in `tsconfig.json`
|
||||
|
@ -252,6 +252,7 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
||||
} else {
|
||||
await prepare(nitro)
|
||||
await copyPublicAssets(nitro)
|
||||
await nuxt.callHook('nitro:build:public-assets', nitro)
|
||||
await prerender(nitro)
|
||||
if (!nuxt.options._generate) {
|
||||
logger.restoreAll()
|
||||
|
@ -217,6 +217,12 @@ export interface NuxtHooks {
|
||||
* @returns Promise
|
||||
*/
|
||||
'nitro:build:before': (nitro: Nitro) => HookResult
|
||||
/**
|
||||
* Called after copying public assets. Allows modifying public assets before Nitro server is built.
|
||||
* @param nitro The created nitro object
|
||||
* @returns Promise
|
||||
*/
|
||||
'nitro:build:public-assets': (nitro: Nitro) => HookResult
|
||||
/**
|
||||
* Allows extending the routes to be pre-rendered.
|
||||
* @param ctx Nuxt context
|
||||
|
Loading…
Reference in New Issue
Block a user