fix(docs): fix mdx loader cache invalidation bug on versions changes (#10934)

This commit is contained in:
Sébastien Lorber 2025-02-14 17:46:41 +01:00 committed by GitHub
parent a72a06ecb1
commit af272bdefa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 36 additions and 0 deletions

View file

@ -218,6 +218,7 @@ export async function mdxLoader(
const compilerName = getWebpackLoaderCompilerName(this);
const callback = this.async();
const options: Options = this.getOptions();
options.dependencies?.forEach(this.addDependency);
try {
const result = await loadMDXWithCaching({
resource: this.resource,

View file

@ -11,6 +11,8 @@ import type {ResolveMarkdownLink} from './remark/resolveMarkdownLinks';
import type {PromiseWithResolvers} from './utils';
export type Options = Partial<MDXOptions> & {
dependencies?: string[];
markdownConfig: MarkdownConfig;
staticDirs: string[];
siteDir: string;