From c7fb082e4d7dc026ff57b993e57a0738c2394feb Mon Sep 17 00:00:00 2001 From: Lukas Holzer Date: Fri, 11 Aug 2023 14:36:37 +0200 Subject: [PATCH] fix: fixes an issue where the package_path was not passed to netlify build for config mutations (#5943) --- src/commands/build/build.mjs | 1 + src/commands/deploy/deploy.mjs | 5 ++++- src/lib/build.mjs | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/commands/build/build.mjs b/src/commands/build/build.mjs index cbbbe904b50..e40d4455cbc 100644 --- a/src/commands/build/build.mjs +++ b/src/commands/build/build.mjs @@ -48,6 +48,7 @@ const build = async (options, command) => { const buildOptions = await getBuildOptions({ cachedConfig, + packagePath: command.workspacePackage, token, options, }) diff --git a/src/commands/deploy/deploy.mjs b/src/commands/deploy/deploy.mjs index 81b2e9c8986..7286560001c 100644 --- a/src/commands/deploy/deploy.mjs +++ b/src/commands/deploy/deploy.mjs @@ -400,16 +400,18 @@ const runDeploy = async ({ * * @param {object} config * @param {*} config.cachedConfig + * @param {string} [config.packagePath] * @param {import('commander').OptionValues} config.options The options of the command * @returns */ -const handleBuild = async ({ cachedConfig, options }) => { +const handleBuild = async ({ cachedConfig, options, packagePath }) => { if (!options.build) { return {} } const [token] = await getToken() const resolvedOptions = await getBuildOptions({ cachedConfig, + packagePath, token, options, }) @@ -589,6 +591,7 @@ const deploy = async (options, command) => { } const { configMutations = [], newConfig } = await handleBuild({ + packagePath: command.workspacePackage, cachedConfig: command.netlify.cachedConfig, options, }) diff --git a/src/lib/build.mjs b/src/lib/build.mjs index 328d9cbd0a2..5e6c3283cb9 100644 --- a/src/lib/build.mjs +++ b/src/lib/build.mjs @@ -19,6 +19,7 @@ import { featureFlags as edgeFunctionsFeatureFlags } from './edge-functions/cons * * @param {object} config * @param {*} config.cachedConfig + * @param {string} [config.packagePath] * @param {string} config.token * @param {import('commander').OptionValues} config.options * @returns {BuildConfig} @@ -26,10 +27,12 @@ import { featureFlags as edgeFunctionsFeatureFlags } from './edge-functions/cons export const getBuildOptions = ({ cachedConfig, options: { context, cwd, debug, dry, json, offline, silent }, + packagePath, token, }) => ({ cachedConfig, siteId: cachedConfig.siteInfo.id, + packagePath, token, dry, debug,