diff --git a/src/index.ts b/src/index.ts
index 8f400b4..84f92c5 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -49,10 +49,10 @@ function createPlugin(
 
                 return resolved?.id
               },
-              getCompiler() {
+              getCompiler(filePath) {
                 const remarkPlugins = mergeArrays(
                   globalMdxOptions.remarkPlugins,
-                  getMdxOptions?.(id).remarkPlugins
+                  getMdxOptions?.(filePath).remarkPlugins
                 )
                 remarkPlugins.push(mdxImportPlugin)
                 return mdx.createMdxAstCompiler({