@nx/esbuild - Migrations
For an overview of the plugin and setup instructions, see the @nx/esbuild introduction.
The @nx/esbuild plugin provides various migrations to help you migrate to newer versions of esbuild projects within your Nx workspace. Below is a complete reference for all available migrations.
24.1.x
Section titled “24.1.x”update-24-1-0-add-dependent-tasks-output-files-input
Section titled “update-24-1-0-add-dependent-tasks-output-files-input”Version: 24.1.0-beta.4
Adds a dependentTasksOutputFiles input to the inputs of @nx/esbuild:esbuild targets and target defaults, so a build is not restored from the cache after the output of a task it depends on has changed
Hash the outputs of dependent tasks in esbuild builds
Section titled “Hash the outputs of dependent tasks in esbuild builds”Adds a dependentTasksOutputFiles input to the inputs of @nx/esbuild:esbuild targets, in the targetDefaults of nx.json and in project configuration.
esbuild bundles a workspace library from that library’s build output when its package.json points there. Without this input, nothing in the task’s hash covers those files, so the build can be restored from the cache after a dependency’s output has changed.
Targets and targetDefaults entries that declare no inputs, or that already list a dependentTasksOutputFiles input, are left as they are.
Sample code changes
Section titled “Sample code changes”Before
Section titled “Before”{ "targetDefaults": { "@nx/esbuild:esbuild": { "cache": true, "dependsOn": ["^build"], "inputs": ["production", "^production"] } }}{ "targetDefaults": { "@nx/esbuild:esbuild": { "cache": true, "dependsOn": ["^build"], "inputs": [ "production", "^production", { "dependentTasksOutputFiles": "**/*", "transitive": true } ] } }}