File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,7 @@ export default function (extensions: string[]): AstroIntegration {
69
69
".mkd" ,
70
70
".mdwn" ,
71
71
".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
+ ] ;
76
73
77
74
let filesInPages : Map <
78
75
string ,
@@ -82,14 +79,23 @@ export default function (extensions: string[]): AstroIntegration {
82
79
}
83
80
> ;
84
81
85
- let pagesDir = "" ;
82
+ let pagesDir : string ;
86
83
87
84
async function configSetupHook ( options : {
88
85
config : AstroConfig ;
89
86
updateConfig : ( _ : Partial < AstroConfig > ) => unknown ;
90
87
} ) : Promise < void > {
91
88
pagesDir = fileURLToPath ( new URL ( "./pages" , options . config . srcDir ) ) ;
92
89
90
+ if (
91
+ options . config . integrations . findIndex ( ( i ) => i . name === "@astrojs/mdx" ) <
92
+ 0
93
+ ) {
94
+ // ".mdx" is added by @astrojs/mdx integration through addPageExtension(), but
95
+ // there is no way to peek the current value of AstroSettings.pageExtensions.
96
+ pageExtensions . push ( ".mdx" ) ;
97
+ }
98
+
93
99
insertPageExtensions ( options , extensions ) ;
94
100
95
101
filesInPages = new Map (
You can’t perform that action at this time.
0 commit comments