# Interface ImportMeta

The type of `import.meta`.

If you need to declare that a given property exists on `import.meta`, this type may be augmented via interface merging.

interface ImportMeta {
dirname : string;
env : ImportMetaEnv ;
filename : string;
glob : ImportGlobFunction;
globEager : ImportGlobEagerFunction;
hot ?: ViteHotContext;
url : string;
resolve (specifier, parent?): string;
}

- Defined in node_modules/typescript/lib/lib.es5.d.ts:631
- Defined in node_modules/typescript/lib/lib.dom.d.ts:679
- Defined in node_modules/vite/types/importMeta.d.ts:14
- Defined in src/vite.env.d.ts:10
- Defined in node_modules/@types/node/module.d.ts:278

#####
Index

### Properties

dirname
env
filename
glob
globEager
hot?
url

### Methods

resolve

## Properties

### dirname

dirname: string

The directory name of the current module. This is the same as the `path.dirname()` of the `import.meta.filename`. Caveat: only present on `file:` modules.

- Defined in node_modules/@types/node/module.d.ts:283

### `Readonly` env

env: ImportMetaEnv

- Defined in node_modules/vite/types/importMeta.d.ts:19
- Defined in src/vite.env.d.ts:11

### filename

filename: string

The full absolute path and filename of the current module, with symlinks resolved. This is the same as the `url.fileURLToPath()` of the `import.meta.url`. Caveat: only local modules support this property. Modules not using the `file:` protocol will not provide it.

- Defined in node_modules/@types/node/module.d.ts:289

### glob

glob: ImportGlobFunction

- Defined in node_modules/vite/types/importMeta.d.ts:21

### globEager

globEager: ImportGlobEagerFunction

#### Deprecated

Use `import.meta.glob('*', { eager: true })` instead

- Defined in node_modules/vite/types/importMeta.d.ts:25

### `Optional` `Readonly` hot

hot?: ViteHotContext

- Defined in node_modules/vite/types/importMeta.d.ts:17

### url

url: string

The absolute `file:` URL of the module.

- Defined in node_modules/typescript/lib/lib.dom.d.ts:680
- Defined in node_modules/vite/types/importMeta.d.ts:15
- Defined in node_modules/@types/node/module.d.ts:293

## Methods

### resolve

- resolve(specifier, parent?): string

- Provides a module-relative resolution function scoped to each module, returning the URL string.

  Second `parent` parameter is only used when the `--experimental-import-meta-resolve` command flag enabled.

  #### Parameters

  - specifier: string

    The module specifier to resolve relative to `parent`.

  - `Optional` parent: string | URL

    The absolute parent module URL to resolve from.

  #### Returns string

  The absolute (`file:`) URL string for the resolved module.

  #### Since

  v20.6.0

  - Defined in node_modules/@types/node/module.d.ts:307