Skip to content

Commit c3e7740

Browse files
committed
minor fix
1 parent 0892de8 commit c3e7740

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/lib/ignoreassets/index.ts

+10-5
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ export default function (extensions: string[]): AstroIntegration {
6969
".mkd",
7070
".mdwn",
7171
".md",
72-
// ".mdx" is added by @astrojs/mdx integration through addPageExtension(), but
73-
// there is no way to peek the current value of AstroSettings.pageExtensions.
74-
".mdx",
75-
] as const;
72+
];
7673

7774
let filesInPages: Map<
7875
string,
@@ -82,14 +79,22 @@ export default function (extensions: string[]): AstroIntegration {
8279
}
8380
>;
8481

85-
let pagesDir = "";
82+
let pagesDir: string;
8683

8784
async function configSetupHook(options: {
8885
config: AstroConfig;
8986
updateConfig: (_: Partial<AstroConfig>) => unknown;
9087
}): Promise<void> {
9188
pagesDir = fileURLToPath(new URL("./pages", options.config.srcDir));
9289

90+
if (
91+
options.config.integrations.findIndex((i) => i.name === "@astrojs/mdx")
92+
) {
93+
// ".mdx" is added by @astrojs/mdx integration through addPageExtension(), but
94+
// there is no way to peek the current value of AstroSettings.pageExtensions.
95+
pageExtensions.push(".mdx");
96+
}
97+
9398
insertPageExtensions(options, extensions);
9499

95100
filesInPages = new Map(

0 commit comments

Comments
 (0)