发布

  • fix(bundling): declare tsconfig.json as input for esbuild targets (#35432)

    frostbyte_neo 发布于 2026-04-24 15:37:00 +00:00

    Current Behavior

    The @nx/esbuild:esbuild executor calls isUsingTsSolutionSetup at
    task runtime, which reads extends, files, and include from the
    workspace-root tsconfig.json. Targets using the executor do not
    declare those fields as inputs, so cache hashes do not reflect changes
    to them and builds can hit stale cache entries after a tsconfig.json
    edit.

    Expected Behavior

    Targets using the @nx/esbuild:esbuild executor include a field-scoped
    {workspaceRoot}/tsconfig.json input covering exactly the fields the
    executor reads, so hashes change when those fields change and remain
    unaffected by unrelated edits.

    • addBuildTargetDefaults gains an optional extraInputs parameter so
      plugin generators can extend the default/production inputs when seeding
      executor-keyed target defaults. Existing call sites are unchanged.
    • The @nx/esbuild:configuration generator uses that parameter to add a
      field-scoped {workspaceRoot}/tsconfig.json input (fields: extends,
      files, include) to the @nx/esbuild:esbuild target defaults it
      seeds.
    • This repo's nx.json gains the same executor-keyed target defaults so
      tools-documentation-create-embeddings (the only esbuild target in the
      repo) inherits the fix. dependsOn mirrors the existing build
      target-name default to preserve the inferred typecheck and
      build-base dependencies.
    下载附件