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;
    hot?: ViteHotContext;
    main: boolean;
    url: string;
    resolve(specifier: string): string;
    resolve(specifier: string, parent?: string | URL): string;
}

Properties

dirname: string
filename: string
glob: ImportGlobFunction
hot?: ViteHotContext
main: boolean
url: string

Methods

  • Parameters

    • specifier: string

    Returns string

  • Parameters

    • specifier: string
    • Optionalparent: string | URL

    Returns string