Merge pull request #30981 from storybookjs/jeppe/exclude-node-modules-from-docgen

Svelte: Exclude `node_modules` from docgen
This commit is contained in:
Jeppe Reinhold 2025-03-31 15:02:33 +02:00 committed by GitHub
commit 88639789ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -135,10 +135,11 @@ function transformToSvelteDocParserDataItems(docgen: Docgen): SvelteDataItem[] {
export async function svelteDocgen(svelteOptions: Record<string, any> = {}): Promise<PluginOption> {
const cwd = process.cwd();
const { preprocess: preprocessOptions, logDocgen = false } = svelteOptions;
const include = /\.(svelte)$/;
const include = /\.svelte$/;
const exclude = /node_modules\/.*/;
const { createFilter } = await import('vite');
const filter = createFilter(include);
const filter = createFilter(include, exclude);
const sourceFileCache = createDocgenCache();
let docPreprocessOptions: Parameters<typeof preprocess>[1] | undefined;