ImportMeta.resolve - Web documentation
method ImportMeta.resolve
ImportMeta.resolve(specifier: string): string

A function that returns resolved specifier as if it would be imported using import(specifier).

console.log(import.meta.resolve("./foo.js"));
// file:///dev/foo.js

Parameters

specifier: string

Return Type

string