From 5c7bff363a7768437c74f2122ea57c773847e704 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 11 Jan 2023 13:41:18 +0100 Subject: [PATCH] build: Improve nx caching strategy 1. `build:tarball` is actually not cacheable 2. Make sure that we do not mark a package as needing to rebuild when tests change 3. Add missing dependencies for serverless build --- nx.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/nx.json b/nx.json index 3b2b7778c325..2a801035b45c 100644 --- a/nx.json +++ b/nx.json @@ -6,12 +6,24 @@ "cacheableOperations": [ "build:bundle", "build:transpile", - "build:tarball", "build:types" ] } } }, + "namedInputs": { + "sharedGlobals": [ + "{workspaceRoot}/*.js", + "{workspaceRoot}/*.json", + "{workspaceRoot}/yarn.lock" + ], + "default": [ + "{projectRoot}/**/*", + "sharedGlobals", + "!{projectRoot}/test/**/*", + "!{projectRoot}/**/*.md" + ] + }, "targetDefaults": { "build:bundle": { "dependsOn": [ @@ -58,7 +70,12 @@ "targets": { "@sentry/serverless": { "build:bundle": { - "dependsOn": [], + "dependsOn": [ + "^build:transpile", + "build:transpile", + "^build:types", + "build:types" + ], "outputs": [ "{projectRoot}/build/aws" ]