File tree 1 file changed +10
-5
lines changed
1 file changed +10
-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,22 @@ 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
+ ) {
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
+
93
98
insertPageExtensions ( options , extensions ) ;
94
99
95
100
filesInPages = new Map (
You can’t perform that action at this time.
0 commit comments