Skip to content

Conversation

@sunsunmonkey
Copy link
Contributor

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

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