Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/plugin/examples.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fm from 'front-matter';
import { winPath } from 'dumi/plugin-utils';
import * as fs from 'fs-extra';
import * as glob from 'glob';
import * as path from 'path';
Expand Down Expand Up @@ -48,11 +49,9 @@ const getExampleDemos = (exampleDir: string) => {
* @author YuZhanglong <[email protected]>
*/
const getTopicExamples = (topicPath: string, showAPIDoc: boolean) => {
const examplePaths = glob
.sync(`${topicPath.replace(/\\/g, '/')}/*`)
.filter((item) => {
return !item.endsWith('.js');
});
const examplePaths = glob.sync(`${winPath(topicPath)}/*`).filter((item) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

启动测试过的吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,他本身其实是一样的

return !item.endsWith('.js');
});

return examplePaths
.map((item) => {
Expand Down