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

import.meta

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

import.meta.dev flag

import.meta.dev is a boolean property that is true when running the Nuxt dev server. It can be used for tree-shaking runtime code.

import.meta.client flag

import.meta.client is a boolean property that is true when code is evaluated on the client side. It can be used for tree-shaking runtime code.

import.meta.browser flag

import.meta.browser is a boolean property that is true when code is evaluated on the client side. It can be used for tree-shaking runtime code.

import.meta.server flag

import.meta.server is a boolean property that is true when code is evaluated on the server side. It can be used for tree-shaking runtime code.

import.meta.nitro flag

import.meta.nitro is a boolean property that is true when code is evaluated on the server side. It can be used for tree-shaking runtime code.

import.meta.envName property

import.meta.envName is a string property available in Nuxt v4.5 and later. It represents the current Nuxt environment name, including custom values passed via the --envName flag. It can be used for tree-shaking runtime code.

import.meta.test flag

import.meta.test is a boolean property that is true when running in a test context. It can be used for tree-shaking runtime code.

import.meta.prerender flag

import.meta.prerender is a boolean property that is true when rendering HTML on the server in the prerender stage of your build. It can be used for tree-shaking runtime code.

import.meta.env property

import.meta.env is an object property that equals process.env. It is available both in modules and in nuxt.config.

import.meta.url property

import.meta.url is a string property that contains a resolvable path for the current file. It is available both in modules and in nuxt.config.

Deprecation of process.browser and related properties

process.browser, process.client, process.dev, process.server, and process.test were soft-deprecated in Nuxt 3.12. In Nuxt 5 or when using future.compatibilityVersion: 5, Nuxt no longer augments NodeJS.Process with those properties. Users should prefer the matching import.meta.* flags instead. Build-time process.* defines still exist for compatibility.

Using import.meta.url to resolve files in modules

import.meta.url can be used with createResolver from 'nuxt/kit' to resolve relative file paths within modules. Example: const resolver = createResolver(import.meta.url) creates a resolver function that can resolve paths relative to the current file, such as resolver.resolve('./components/MyModuleComponent.vue').

Give your agent this brain