{
  "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
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/esbuild.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "entries",
        "label": "Entry points",
        "type": "path",
        "position": 0,
        "multiple": true,
        "path": {
          "kind": "file",
          "role": "input"
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "outfile",
        "label": "Output file",
        "description": "For a single entry point.",
        "type": "path",
        "option": [
          "--outfile"
        ],
        "path": {
          "kind": "file",
          "role": "output"
        },
        "effect": "overwrite",
        "sources": [
          "fig"
        ]
      },
      {
        "id": "outdir",
        "label": "Output directory",
        "description": "For multiple entry points.",
        "type": "path",
        "option": [
          "--outdir"
        ],
        "path": {
          "kind": "directory",
          "role": "output"
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "bundle",
        "label": "Bundle dependencies",
        "type": "boolean",
        "option": [
          "--bundle"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "minify",
        "label": "Minify",
        "type": "boolean",
        "option": [
          "--minify"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "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"
        ]
      },
      {
        "id": "platform",
        "label": "Platform",
        "type": "enum",
        "option": [
          "--platform"
        ],
        "choices": [
          {
            "value": "browser",
            "label": "Browser"
          },
          {
            "value": "node",
            "label": "Node"
          },
          {
            "value": "neutral",
            "label": "Neutral"
          }
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "target",
        "label": "Target",
        "description": "ES version or browser version, e.g. es2020 or chrome101.",
        "type": "string",
        "option": [
          "--target"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "external",
        "label": "External modules",
        "type": "string",
        "option": [
          "--external"
        ],
        "multiple": true,
        "sources": [
          "fig"
        ]
      },
      {
        "id": "splitting",
        "label": "Code splitting",
        "type": "boolean",
        "option": [
          "--splitting"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "metafile",
        "label": "Metafile",
        "type": "path",
        "option": [
          "--metafile"
        ],
        "path": {
          "kind": "file",
          "role": "output"
        },
        "effect": "overwrite",
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "bundle-file",
        "label": "Bundle to one file",
        "set": {
          "bundle": [
            true
          ]
        },
        "fields": [
          "entries",
          "outfile",
          "bundle",
          "minify",
          "format",
          "platform",
          "target"
        ],
        "required": [
          "entries",
          "outfile"
        ]
      },
      {
        "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"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "entries",
          "outfile",
          "outdir",
          "bundle",
          "minify"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "format",
          "platform",
          "target",
          "external",
          "splitting",
          "metafile"
        ]
      }
    ]
  }
}
