id = "esbuild" name = "esbuild" description = "An extremely fast JavaScript bundler." homepage = "https://esbuild.github.io" executables = ["esbuild"] [commands] format = 1 label = "Bundle JavaScript" description = "Bundle entry points into output files. Plugins, define/inject, mangling and server options are left out." quality = "ai-draft" base = "fig:esbuild" parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false } [[commands.source]] id = "fig" kind = "completion" url = "https://github.com/withfig/autocomplete/blob/master/src/esbuild.ts" license = "MIT" [[commands.field]] id = "entries" label = "Entry points" type = "path" position = 0 multiple = true path = { kind = "file", role = "input" } sources = ["fig"] [[commands.field]] id = "outfile" label = "Output file" description = "For a single entry point." type = "path" option = ["--outfile"] path = { kind = "file", role = "output" } effect = "overwrite" sources = ["fig"] [[commands.field]] id = "outdir" label = "Output directory" description = "For multiple entry points." type = "path" option = ["--outdir"] path = { kind = "directory", role = "output" } sources = ["fig"] [[commands.field]] id = "bundle" label = "Bundle dependencies" type = "boolean" option = ["--bundle"] sources = ["fig"] [[commands.field]] id = "minify" label = "Minify" type = "boolean" option = ["--minify"] sources = ["fig"] [[commands.field]] id = "format" label = "Output format" type = "enum" option = ["--format"] choices = [{ value = "iife", label = "IIFE" }, { value = "cjs", label = "CommonJS" }, { value = "esm", label = "ES module" }] sources = ["fig"] [[commands.field]] id = "platform" label = "Platform" type = "enum" option = ["--platform"] choices = [{ value = "browser", label = "Browser" }, { value = "node", label = "Node" }, { value = "neutral", label = "Neutral" }] sources = ["fig"] [[commands.field]] id = "target" label = "Target" description = "ES version or browser version, e.g. es2020 or chrome101." type = "string" option = ["--target"] sources = ["fig"] [[commands.field]] id = "external" label = "External modules" type = "string" option = ["--external"] multiple = true sources = ["fig"] [[commands.field]] id = "splitting" label = "Code splitting" type = "boolean" option = ["--splitting"] sources = ["fig"] [[commands.field]] id = "metafile" label = "Metafile" type = "path" option = ["--metafile"] path = { kind = "file", role = "output" } effect = "overwrite" sources = ["fig"] [[commands.task]] id = "bundle-file" label = "Bundle to one file" set = { bundle = [true] } fields = ["entries", "outfile", "bundle", "minify", "format", "platform", "target"] required = ["entries", "outfile"] [[commands.task]] id = "bundle-dir" label = "Bundle with code splitting" set = { bundle = [true], splitting = [true], format = ["esm"] } fields = ["entries", "outdir", "bundle", "splitting", "format", "minify"] required = ["entries", "outdir"] [[commands.group]] id = "basic" label = "Basic" fields = ["entries", "outfile", "outdir", "bundle", "minify"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["format", "platform", "target", "external", "splitting", "metafile"]