We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
webpro
Learn more about funding links in repositories.
Report abuse
1 parent c80ac0e commit 055a2e3Copy full SHA for 055a2e3
packages/knip/src/compilers/mdx.ts
@@ -1,7 +1,21 @@
1
import { fencedCodeBlockMatcher, importMatcher } from './compilers.js';
2
import type { HasDependency } from './types.js';
3
4
-const condition = (hasDependency: HasDependency) => hasDependency('@mdx-js/mdx') || hasDependency('astro');
+// https://mdxjs.com/packages/
5
+const mdxDependencies = [
6
+ 'astro',
7
+ '@mdx-js/esbuild',
8
+ '@mdx-js/loader',
9
+ '@mdx-js/mdx',
10
+ '@mdx-js/node-loader',
11
+ '@mdx-js/preact',
12
+ '@mdx-js/react',
13
+ '@mdx-js/rollup',
14
+ '@mdx-js/vue',
15
+ 'remark-mdx',
16
+];
17
+
18
+const condition = (hasDependency: HasDependency) => mdxDependencies.some(hasDependency);
19
20
const compiler = (text: string) => [...text.replace(fencedCodeBlockMatcher, '').matchAll(importMatcher)].join('\n');
21
0 commit comments