Skip to content

Commit

Permalink
chore(BuildTool): compatible no demo index.tsx for start
Browse files Browse the repository at this point in the history
  • Loading branch information
YSMJ1994 committed Jan 11, 2024
1 parent 62eec1b commit 5d9dbee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/serve/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import createDocParser from '@alifd/doc-parser';
import MagicString from 'magic-string';
import { kebabCase } from 'lodash';
import { glob } from 'glob';
import { ARGV, SRC_DIR_PATH, TARGETS, findFile, logger, parseImportDeclarations } from '../utils';
import { ARGV, SRC_DIR_PATH, TARGETS, findFile, logger, parseImportDeclarations, warn } from '../utils';
import { marked } from '../build/docs/utils';
import { parseDemoMd } from '../build/docs/generate-docs';

Expand Down Expand Up @@ -81,6 +81,11 @@ const demoPlugin = (dirName: string): VitePlugin => {
cssEntry: existsSync(cssEntryPath) ? cssEntryPath : undefined,
jsEntry: existsSync(demoEntryPath) ? demoEntryPath : undefined,
};
}).filter(t => {
if (!t.jsEntry) {
warn(`Not found demo index.tsx: ${t.id}`)
}
return !!t.jsEntry
});
}
const SCSS_REG = /^__scss/;
Expand Down

0 comments on commit 5d9dbee

Please sign in to comment.