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

nuxt-config

149 notes in this subject, read out of this brain and free to use. This is page 1 of 3.

vite.clearScreen configuration

The vite.clearScreen property enables clearing screen on rebuild. Type is boolean. Default is true.

vite.build.assetsDir configuration

The vite.build.assetsDir property sets assets directory for Vite build. Type is string. Default is '_nuxt/'.

alias configuration

The alias property is an object that improves DX by defining additional aliases to access custom directories within JavaScript and CSS. Type is object. Default aliases are: ~ maps to /<rootDir>/app, @ maps to /<rootDir>/app, ~~ maps to /<rootDir>, @@ maps to /<rootDir>, #shared maps to /<rootDir>/shared, #server maps to /<rootDir>/server, assets maps to /<rootDir>/app/assets, public maps to /<rootDir>/public, #build maps to /<rootDir>/.nuxt, #internal/nuxt/paths maps to /<rootDir>/.nuxt/paths.mjs. In webpack context (image sources, CSS but not JavaScript) you must access aliases by prefixing with ~. These aliases are automatically added to generated TypeScript configurations.

analyzeDir configuration

The analyzeDir property specifies the directory where Nuxt stores generated files when running 'nuxt analyze'. Type is string. Default is '/<rootDir>/.nuxt/analyze'. If a relative path is specified, it will be relative to rootDir.

app.baseURL configuration

The app.baseURL property sets the base path of your Nuxt application. Type is string. Default is '/'. Can be set at runtime using the NUXT_APP_BASE_URL environment variable. Relative paths like './' are not supported directly in nuxt.config.ts due to Nitro limitations.

app.buildAssetsDir configuration

The app.buildAssetsDir property specifies the folder name for built site assets, relative to baseURL or cdnURL if set. Type is string. Default is '/_nuxt/'. This is set at build time and should not be customized at runtime.

app.cdnURL configuration

The app.cdnURL property sets an absolute URL to serve the public folder from (production-only). Type is string. Default is empty string. Can be set at runtime using the NUXT_APP_CDN_URL environment variable.

app.head configuration

The app.head property sets default configuration for <head> on every page. Type is object. Default includes meta tags for viewport (width=device-width, initial-scale=1) and charset (utf-8), and empty link, style, script, and noscript arrays. Supports meta, link, style, script, and noscript properties.

app.keepalive configuration

The app.keepalive property sets default values for KeepAlive configuration between pages. Type is boolean. Default is false. Can be overridden with definePageMeta on individual pages. Only JSON-serializable values are allowed.

app.pageTransition configuration

The app.pageTransition property sets default values for page transitions. Type is boolean or TransitionProps. Default is false. Can be overridden with definePageMeta on individual pages. Only JSON-serializable values are allowed.

app.rootAttrs configuration

The app.rootAttrs property customizes Nuxt root element attributes. Type is object. Default is {"id": "__nuxt"}.

app.rootId configuration

The app.rootId property customizes the Nuxt root element id. Type is string. Default is '__nuxt'.

app.rootTag configuration

The app.rootTag property customizes the Nuxt root element tag. Type is string. Default is 'div'.

app.spaLoaderAttrs configuration

The app.spaLoaderAttrs property customizes Nuxt SPA loading template element attributes. Type is object. Default is {"id": "__nuxt-loader"}.

app.spaLoaderTag configuration

The app.spaLoaderTag property customizes the Nuxt SpaLoader element tag. Type is string. Default is 'div'.

app.teleportAttrs configuration

The app.teleportAttrs property customizes Nuxt Teleport element attributes. Type is object. Default is {"id": "teleports"}.

app.teleportId configuration

The app.teleportId property customizes the Nuxt Teleport element id. Type is string. Default is 'teleports'.

app.teleportTag configuration

The app.teleportTag property customizes the Nuxt Teleport element tag. Type is string. Default is 'div'.

app.viewTransition configuration

The app.viewTransition property sets default values for view transitions. Type is boolean. Default is false. This only has effect when experimental support for View Transitions is enabled in nuxt.config. Can be overridden with definePageMeta on individual pages.

appConfig configuration

The appConfig property holds additional app configuration. For programmatic usage and type support, you can directly provide app config with this option. It will be merged with app.config file as default value.

appId configuration

The appId property specifies the unique id of the Nuxt application for multi-app projects. Type is string. Default is 'nuxt-app'.

build.analyze configuration

The build.analyze property allows visualizing bundles and how to optimize them. Set to true to enable bundle analysis, or pass an object with options for webpack or vite. Type is object. Default includes template 'treemap', projectRoot '/<rootDir>', and filename '/<rootDir>/.nuxt/analyze/{name}.html'.

build.templates configuration

The build.templates property defines templates to be built. Type is array. It is recommended to use addTemplate from @nuxt/kit instead of this option. Each template can have src (absolute or relative path) and dst (relative to .nuxt dir) properties.

build.transpile configuration

The build.transpile property specifies specific dependencies to transpile with Babel. Type is array. Each item can be a package name, function, string, or regex object matching the dependency's file name. Functions receive an object with isDev, isServer, isClient, isModern, and isLegacy properties.

buildDir configuration

The buildDir property defines the directory where built Nuxt files will be placed. Type is string. Default is '/<rootDir>/.nuxt'. Many tools assume .nuxt is a hidden directory; you can use this option to prevent that.

buildId configuration

The buildId property is a unique identifier matching the build. Type is string. Default is '4a2e2d30-418f-41df-8e58-ed5df06de7fd'. May contain the hash of the current state of the project.

builder configuration

The builder property specifies the builder to use for bundling the Vue part of your application. Type is 'vite' | 'webpack' | 'rspack' | string | { bundle: (nuxt: Nuxt) => Promise<void> }. Default is '@nuxt/vite-builder'. Nuxt supports vite, webpack, rspack, or custom builder implementations.

compatibilityDate configuration

The compatibilityDate property specifies a compatibility date for your app. Type is string. This is used to control the behavior of presets in Nitro, Nuxt Image, and other modules that may change behavior without a major version bump.

components configuration

The components property configures Nuxt component auto-registration. Type is object. Default includes two directories: ~/components/global with global: true, and ~/components. Any components in configured directories can be used throughout pages and layouts without explicit import.

css configuration

The css property defines CSS files/modules/libraries to set globally (included in every page). Type is array. Nuxt automatically guesses file type by extension and uses the appropriate pre-processor. You must still install required loaders if needed.

debug configuration

The debug property enables debug mode. Type is boolean. Default is false. When true, prints hook names and timings on server, and logs hook arguments in browser. Can also be set to an object to enable specific debug options.

dev configuration

The dev property indicates whether Nuxt is running in development mode. Type is boolean. Default is false. Normally you should not need to set this.

devServer.cors configuration

The devServer.cors property sets CORS options for the dev server. The origin property is type array with default [{}].

devServer.https configuration

The devServer.https property enables HTTPS for the dev server. Type is boolean. Default is false. Can also be an object with key and cert properties for SSL certificates.

devServer.loadingTemplate configuration

The devServer.loadingTemplate property defines a template to show a loading screen. Type is function.

devServer.port configuration

The devServer.port property sets the dev server listening port. Type is number. Default is 3000.

devServer.url configuration

The devServer.url property is the listening dev server URL. Type is string. Default is 'http://localhost:3000'. This should not be set directly as it will always be overridden by the dev server with the full URL.

devServerHandlers configuration

The devServerHandlers property defines Nitro development-only server handlers. Type is array. See Nitro server routes documentation for details.

devtools configuration

The devtools property enables Nuxt DevTools for development. Breaking changes for devtools might not reflect on the version of Nuxt. See Nuxt DevTools documentation for more information.

dir.app configuration

The dir.app property customizes the app directory. Type is string. Default is 'app'.

dir.assets configuration

The dir.assets property specifies the assets directory (aliased as ~assets in build). Type is string. Default is 'app/assets'.

dir.layouts configuration

The dir.layouts property specifies the layouts directory where each file is auto-registered as a Nuxt layout. Type is string. Default is 'app/layouts'.

dir.middleware configuration

The dir.middleware property specifies the middleware directory where each file is auto-registered as a Nuxt middleware. Type is string. Default is 'app/middleware'.

dir.modules configuration

The dir.modules property specifies the modules directory where each file is auto-registered as a Nuxt module. Type is string. Default is 'modules'.

dir.pages configuration

The dir.pages property specifies the directory processed to auto-generate application page routes. Type is string. Default is 'app/pages'.

dir.plugins configuration

The dir.plugins property specifies the plugins directory where each file is auto-registered as a Nuxt plugin. Type is string. Default is 'app/plugins'.

dir.public configuration

The dir.public property specifies the directory containing static files, directly accessible via Nuxt server and copied into dist folder on generate. Type is string. Default is 'public'.

dir.shared configuration

The dir.shared property specifies the shared directory, shared between app and server. Type is string. Default is 'shared'.

esbuild.options.jsxFactory configuration

The esbuild.options.jsxFactory property sets the JSX factory. Type is string. Default is 'h'.

esbuild.options.jsxFragment configuration

The esbuild.options.jsxFragment property sets the JSX fragment. Type is string. Default is 'Fragment'.

esbuild.options.target configuration

The esbuild.options.target property sets the esbuild target. Type is string. Default is 'esnext'.

esbuild.options.tsconfigRaw configuration

The esbuild.options.tsconfigRaw property passes raw tsconfig options to esbuild. Type is object.

extensions configuration

The extensions property specifies extensions to be resolved by the Nuxt resolver. Type is array. Default includes '.js', '.jsx', '.mjs', '.ts', '.tsx', '.vue'.

extends configuration

The extends property extends project from multiple local or remote sources. Value should be string or array of strings pointing to source directories or config path relative to current config. Supports github:, gh:, gitlab:, bitbucket: protocols.

features configuration

The features property enables opt-in features in Nuxt. Refer to Nuxt's features documentation to learn about available options.

future configuration

The future property allows opting-in to new features that will become default in future Nuxt versions. Refer to Nuxt's features documentation for details.

hooks configuration

The hooks property defines listeners to Nuxt events, typically used in modules but also available in nuxt.config. Hooks follow naming pattern using colons (e.g., build:done). Can be structured as hierarchical object in nuxt.config for ease of configuration.

ignore configuration

The ignore property specifies glob patterns for files that will be ignored in building. Type is array. More customizable than ignorePrefix. Default includes story files, test files, type definition files, and various build/cache directories.

ignoreOptions configuration

The ignoreOptions property passes options directly to node-ignore used by Nuxt to ignore files. Accepts options compatible with node-ignore library.

vite.cacheDir configuration

The vite.cacheDir property sets Vite cache directory. Type is string. Default is '/<rootDir>/node_modules/.cache/vite'.

Give your agent this brain