diff --git a/core/src/resolve-module.ts b/core/src/resolve-module.ts index fe0b17ff8d..9fe342ee6b 100644 --- a/core/src/resolve-module.ts +++ b/core/src/resolve-module.ts @@ -27,6 +27,7 @@ import Bluebird from "bluebird" import { readFile, mkdirp, writeFile } from "fs-extra" import { LogEntry } from "./logger/log-entry" import { ModuleConfigContext } from "./config/template-contexts/module" +import { pathToCacheContext } from "./cache" // This limit is fairly arbitrary, but we need to have some cap on concurrent processing. export const moduleResolutionConcurrencyLimit = 40 @@ -426,6 +427,12 @@ export class ModuleResolver { } }) + // Make sure version is re-computed after writing files + if (!!resolvedConfig.generateFiles?.length) { + const cacheContext = pathToCacheContext(resolvedConfig.path) + this.garden.cache.invalidateUp(cacheContext) + } + const module = await moduleFromConfig(this.garden, this.log, resolvedConfig, dependencies) const moduleTypeDefinitions = await this.garden.getModuleTypes()