Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use umi winPath to deal with path #281

Open
wants to merge 2 commits into
base: v3
Choose a base branch
from

Conversation

sunsunmonkey
Copy link
Contributor

用umi的方法直接处理path的正反斜杆

@@ -4,6 +4,7 @@ import * as glob from 'glob';
import * as path from 'path';
import { Demo, Example, ExampleTopic } from '../types';
import { getExampleAPI } from './api';
import { winPath } from 'dumi/plugin-utils';
Copy link
Member

Choose a reason for hiding this comment

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

放到第二行,import 顺序有一些规范的。

.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.

嗯,他本身其实是一样的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants