new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Nuxt · API · all subjects

hooks/nuxt-build

48 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

imports:dirs hook

The `imports:dirs` hook allows extending import directories. It receives `dirs` as an argument and runs at build time.

webpack:change hook

The `webpack:change` hook is called on `change` on WebpackBar. It receives `shortPath` as an argument and runs at build time.

webpack:error hook

The `webpack:error` hook is called on `done` if there are errors on WebpackBar. It takes no arguments and runs at build time.

webpack:done hook

The `webpack:done` hook is called on `allDone` on WebpackBar. It takes no arguments and runs at build time.

webpack:progress hook

The `webpack:progress` hook is called on `progress` on WebpackBar. It receives `statesArray` as an argument and runs at build time.

kit:compatibility hook

The `kit:compatibility` hook allows extending compatibility checks. It receives `compatibility, issues` as arguments and runs at build time.

ready hook

The `ready` hook is called after Nuxt initialization, when the Nuxt instance is ready to work. It receives `nuxt` as an argument and runs at build time.

close hook

The `close` hook is called when Nuxt instance is gracefully closing. It receives `nuxt` as an argument and runs at build time.

restart hook

The `restart` hook is called to restart the current Nuxt instance. It receives `{ hard?: boolean }` as an argument and runs at build time.

modules:before hook

The `modules:before` hook is called during Nuxt initialization, before installing user modules. It takes no arguments and runs at build time.

modules:done hook

The `modules:done` hook is called during Nuxt initialization, after installing user modules. It takes no arguments and runs at build time.

app:resolve hook

The `app:resolve` hook is called after resolving the `app` instance. It receives `app` as an argument and runs at build time.

app:templates hook

The `app:templates` hook is called during `NuxtApp` generation to allow customizing, modifying or adding new files to the build directory (either virtually or written to `.nuxt`). It receives `app` as an argument and runs at build time.

app:templatesGenerated hook

The `app:templatesGenerated` hook is called after templates are compiled into the virtual file system (vfs). It receives `app` as an argument and runs at build time.

build:before hook

The `build:before` hook is called before Nuxt bundle builder. It takes no arguments and runs at build time.

build:done hook

The `build:done` hook is called after Nuxt bundle builder is complete. It takes no arguments and runs at build time.

build:manifest hook

The `build:manifest` hook is called during the manifest build by Vite and webpack. It receives `manifest` as an argument. This allows customizing the manifest that Nitro will use to render `<script>` and `<link>` tags in the final HTML. It runs at build time.

builder:generateApp hook

The `builder:generateApp` hook is called before generating the app. It receives `options` as an argument and runs at build time.

builder:watch hook

The `builder:watch` hook is called at build time in development when the watcher spots a change to a file or directory in the project. It receives `event, path` as arguments.

pages:extend hook

The `pages:extend` hook is called after page routes are scanned from the file system. It receives `pages` as an argument and runs at build time.

pages:resolved hook

The `pages:resolved` hook is called after page routes have been augmented with scanned metadata. It receives `pages` as an argument and runs at build time.

pages:routerOptions hook

The `pages:routerOptions` hook is called when resolving `router.options` files. It receives `{ files: Array<{ path: string, optional?: boolean }> }` as an argument. Later items in the array override earlier ones. It runs at build time.

server:devHandler hook

The `server:devHandler` hook is called when the dev middleware is being registered on the Nitro dev server. It receives `handler` as an argument and runs at build time.

imports:sources hook

The `imports:sources` hook is called at setup allowing modules to extend sources. It receives `presets` as an argument and runs at build time.

imports:extend hook

The `imports:extend` hook is called at setup allowing modules to extend imports. It receives `imports` as an argument and runs at build time.

imports:context hook

The `imports:context` hook is called when the unimport context is created. It receives `context` as an argument and runs at build time.

components:dirs hook

The `components:dirs` hook is called within `app:resolve` allowing to extend the directories that are scanned for auto-importable components. It receives `dirs` as an argument and runs at build time.

components:extend hook

The `components:extend` hook allows extending new components. It receives `components` as an argument and runs at build time.

nitro:config hook

The `nitro:config` hook is called before initializing Nitro, allowing customization of Nitro's configuration. It receives `nitroConfig` as an argument and runs at build time.

nitro:init hook

The `nitro:init` hook is called after Nitro is initialized, which allows registering Nitro hooks and interacting directly with Nitro. It receives `nitro` as an argument and runs at build time.

nitro:build:before hook

The `nitro:build:before` hook is called before building the Nitro instance. It receives `nitro` as an argument and runs at build time.

nitro:build:public-assets hook

The `nitro:build:public-assets` hook is called after copying public assets. It receives `nitro` as an argument and allows modifying public assets before Nitro server is built. It runs at build time.

prerender:routes hook

The `prerender:routes` hook allows extending the routes to be pre-rendered. It receives `ctx` as an argument and runs at build time.

build:error hook

The `build:error` hook is called when an error occurs at build time. It receives `error` as an argument.

prepare:types hook

The `prepare:types` hook is called before `@nuxt/cli` writes TypeScript configuration files (`.nuxt/tsconfig.app.json`, `.nuxt/tsconfig.server.json`, etc.) and `.nuxt/nuxt.d.ts`. It receives `options` as an argument and allows addition of custom references and declarations in `nuxt.d.ts`, or directly modifying the options in generated configurations. It runs at build time.

listen hook

The `listen` hook is called when the dev server is loading. It receives `listenerServer, listener` as arguments and runs at build time.

schema:extend hook

The `schema:extend` hook allows extending default schemas. It receives `schemas` as an argument and runs at build time.

schema:resolved hook

The `schema:resolved` hook allows extending resolved schema. It receives `schema` as an argument and runs at build time.

schema:beforeWrite hook

The `schema:beforeWrite` hook is called before writing the given schema. It receives `schema` as an argument and runs at build time.

schema:written hook

The `schema:written` hook is called after the schema is written. It takes no arguments and runs at build time.

vite:extend hook

The `vite:extend` hook allows extending Vite default context. It receives `viteBuildContext` as an argument and runs at build time.

vite:extendConfig hook

The `vite:extendConfig` hook allows extending Vite default config. It receives `viteInlineConfig, env` as arguments and runs at build time. This hook is deprecated in Nuxt 5+. In Nuxt 5, it operates on a shared configuration rather than separate client/server configs.

vite:configResolved hook

The `vite:configResolved` hook allows reading the resolved Vite config. It receives `viteInlineConfig, env` as arguments and runs at build time. This hook is deprecated in Nuxt 5+. In Nuxt 5, it operates on a shared configuration rather than separate client/server configs.

vite:serverCreated hook

The `vite:serverCreated` hook is called when the Vite server is created. It receives `viteServer, env` as arguments and runs at build time.

vite:compiled hook

The `vite:compiled` hook is called after Vite server is compiled. It takes no arguments and runs at build time.

webpack:config hook

The `webpack:config` hook is called before configuring the webpack compiler. It receives `webpackConfigs` as an argument and runs at build time.

webpack:configResolved hook

The `webpack:configResolved` hook allows reading the resolved webpack config. It receives `webpackConfigs` as an argument and runs at build time.

webpack:compiled hook

The `webpack:compiled` hook is called after resources are loaded. It receives `options` as an argument and runs at build time.

Give your agent this brain