Volt.Builder.Resolver (Volt v0.23.0)

Copy Markdown View Source

Resolve import specifiers to absolute file paths for the build graph.

Summary

Functions

Return whether a resolved path is the empty module.

Return whether a module path, with or without a query, lies in a node_modules directory.

Resolve an import specifier to an absolute file path.

Functions

absolute?(specifier)

empty_module?(path)

Return whether a resolved path is the empty module.

inside_node_modules?(importer)

@spec inside_node_modules?(String.t() | nil) :: boolean()

Return whether a module path, with or without a query, lies in a node_modules directory.

resolve(specifier, importer, ctx)

Resolve an import specifier to an absolute file path.

Returns {:ok, path}, :skip (for externals/node builtins), or {:error, reason}.