diff --git a/tools/wpdev/src/commands/bundle.ts b/tools/wpdev/src/commands/bundle.ts index 36164328..cf379e48 100644 --- a/tools/wpdev/src/commands/bundle.ts +++ b/tools/wpdev/src/commands/bundle.ts @@ -148,7 +148,7 @@ export default class Bundle extends WithProjects { const projectInfo = project.wpdev; - const bundle = await getProjectBundleConfig(project); + const bundle = await getProjectBundleConfig(project, { version }); const outDir = this.getOutputDir(project); diff --git a/tools/wpdev/src/utils/projects.ts b/tools/wpdev/src/utils/projects.ts index 453e87a6..754475ba 100644 --- a/tools/wpdev/src/utils/projects.ts +++ b/tools/wpdev/src/utils/projects.ts @@ -36,7 +36,7 @@ export type ProjectConfig = { getBundleConfig: ( options: Required & { project: WPProject; - version?: string; + version: string; }, ) => BundleConfigInput; }; @@ -149,12 +149,13 @@ export async function getProjectInfo( } type ProjectBundleConfigOptions = { + version: string; globalConfig?: string; }; export async function getProjectBundleConfig( project: WPProject, - { globalConfig }: ProjectBundleConfigOptions = {}, + { globalConfig, version }: ProjectBundleConfigOptions, ) { const configPath = path.join(project.dir, PROJECT_CONFIG_FILE_NAME); const configPathRel = path.relative(process.cwd(), configPath); @@ -177,7 +178,7 @@ export async function getProjectBundleConfig( } const bundleResult = bundleSchema.safeParse( - getBundleConfig({ project, ...project.wpdev }), + getBundleConfig({ project, ...project.wpdev, version }), ); if (!bundleResult.success) {