Skip to content

Commit

Permalink
fix: fixes an issue where the package_path was not passed to netlify …
Browse files Browse the repository at this point in the history
…build for config mutations (#5943)
  • Loading branch information
lukasholzer authored Aug 11, 2023
1 parent b381412 commit c7fb082
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/commands/build/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const build = async (options, command) => {

const buildOptions = await getBuildOptions({
cachedConfig,
packagePath: command.workspacePackage,
token,
options,
})
Expand Down
5 changes: 4 additions & 1 deletion src/commands/deploy/deploy.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down Expand Up @@ -589,6 +591,7 @@ const deploy = async (options, command) => {
}

const { configMutations = [], newConfig } = await handleBuild({
packagePath: command.workspacePackage,
cachedConfig: command.netlify.cachedConfig,
options,
})
Expand Down
3 changes: 3 additions & 0 deletions src/lib/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@ 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}
*/
export const getBuildOptions = ({
cachedConfig,
options: { context, cwd, debug, dry, json, offline, silent },
packagePath,
token,
}) => ({
cachedConfig,
siteId: cachedConfig.siteInfo.id,
packagePath,
token,
dry,
debug,
Expand Down

1 comment on commit c7fb082

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Dependency count: 1,313
  • Package size: 271 MB

Please sign in to comment.