UNPKG

knip

Version:

Find and fix unused dependencies, exports and files in your TypeScript and JavaScript projects

16 lines (15 loc) 517 B
import { fencedCodeBlockMatcher, importMatcher } from './compilers.js'; const mdxDependencies = [ '@mdx-js/esbuild', '@mdx-js/loader', '@mdx-js/mdx', '@mdx-js/node-loader', '@mdx-js/preact', '@mdx-js/react', '@mdx-js/rollup', '@mdx-js/vue', 'remark-mdx', ]; const condition = (hasDependency) => mdxDependencies.some(hasDependency); const compiler = (text) => [...text.replace(fencedCodeBlockMatcher, '').matchAll(importMatcher)].join('\n'); export default { condition, compiler };