menu
ImportMeta
import { ImportMeta } from "destack:module";
Metadata about the current module and build configuration.
1export interface ImportMeta {2 url: string;3 path: string | undefined;4 file: string | undefined;5 filename: string | undefined;6 dir: string | undefined;7 dirname: string | undefined;8 output: "bundle" | "program";9 platform: "unknown" | "windows" | "macos" | "linux" | "freebsd" | "openbsd" | "netbsd" | "dragonfly" | "solaris" | "illumos" | "haiku" | "fuchsia" | "redox" | "hermit" | "none";10 runtime: "destack" | "js";11 target: Dynamic<ImportMetaTarget>;12 targetName: string | undefined;13 product: string | undefined;14 version: string | undefined;15 stage: "experimental" | "alpha" | "beta" | "stable" | undefined;16 derive: readonly Derive[];17 role: string | undefined;18 labels: { readonly [key: string]: readonly string[] | undefined };19 host: "native" | "browser" | "wasi" | "emscripten" | "freestanding";20 modes: readonly string[];21 roles: readonly string[];22 features: readonly string[];23 tags: readonly string[];24 debug: boolean;25 dev: boolean;26 prod: boolean;27 test: boolean;28 bench: boolean;29 lint: boolean;30 env: Dynamic<ImportMetaEnv>;31}Members
url: stringThe URL of the current module (file:// for local, https:// for remote).
path: string | undefinedThe file system path of the current module (only for local files).
file: string | undefinedAlias of
path.filename: string | undefinedAlias of
file.dir: string | undefinedThe directory containing the current module (only for local files).
dirname: string | undefinedAlias of
dir.output: "bundle" | "program"The artifact produced by the current build target.
platform: "unknown" | "windows" | "macos" | "linux" | "freebsd" | "openbsd" | "netbsd" | "dragonfly" | "solaris" | "illumos" | "haiku" | "fuchsia" | "redox" | "hermit" | "none"The target platform (OS) being compiled for.
runtime: "destack" | "js"The semantic runtime contract for this build.
target: Dynamic<ImportMetaTarget>Structured target metadata.
targetName: string | undefinedActive build target name.
product: string | undefinedActive deliverable product name.
version: string | undefinedActive package version.
stage: "experimental" | "alpha" | "beta" | "stable" | undefinedActive package release stage.
derive: readonly Derive[]Auto-derives declared by the current module.
role: string | undefinedActive product role.
labels: { readonly [key: string]: readonly string[] | undefined }Labels contributed by active source graph conditions.
host: "native" | "browser" | "wasi" | "emscripten" | "freestanding"Target host environment.
modes: readonly string[]Active source graph modes.
roles: readonly string[]Active source graph roles.
features: readonly string[]Active source graph features.
tags: readonly string[]Active source graph tags.
debug: booleanTrue when the debug mode is active.
dev: booleanTrue when the development mode is active.
prod: booleanTrue when the production mode is active.
test: booleanTrue when the test mode is active.
bench: booleanTrue when the benchmark mode is active.
lint: booleanTrue when the lint mode is active.
env: Dynamic<ImportMetaEnv>Environment variables (from build configuration).