@@ -264,7 +264,7 @@ async function tryParseImports(
264
264
if ( Object . keys ( fragments ) . length !== 0 ) {
265
265
// add platform specific fragments to source
266
266
await Promise . all (
267
- fragments [ platform ] . map ( async ( fragment ) => {
267
+ fragments [ platform ] ? .map ( async ( fragment ) => {
268
268
const fragmentPath = path . join ( __dirname , '..' , fragment ) ;
269
269
const fragmentFile = sanitizeMDX (
270
270
fs . readFileSync ( fragmentPath , 'utf8' )
@@ -274,7 +274,7 @@ async function tryParseImports(
274
274
platform
275
275
) ;
276
276
source = source + '\n' + allFragments ;
277
- } )
277
+ } ) || [ ]
278
278
) ;
279
279
280
280
// remove unused fragments and imports from markdown
@@ -289,6 +289,21 @@ async function tryParseImports(
289
289
source = source . join ( '\n' ) ;
290
290
}
291
291
292
+ // remove INTEGRATION_FILTER_OPTIONS variables
293
+ source = source . split ( '\n' ) ;
294
+ source = source . map ( ( line ) => {
295
+ if ( line . includes ( 'INTEGRATION_FILTER_OPTIONS' ) ) {
296
+ if ( line . includes ( 'import' ) ) {
297
+ line = '' ;
298
+ } else {
299
+ line = line . replaceAll ( 'INTEGRATION_FILTER_OPTIONS' , "''" ) ;
300
+ }
301
+ }
302
+ return line ;
303
+ } ) ;
304
+
305
+ source = source . join ( '\n' ) ;
306
+
292
307
const meta = await extractMdxMeta ( source ) ;
293
308
294
309
meta . title = platformMap [ platform ]
0 commit comments