mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 19:24:16 +00:00
@@ -5,7 +5,8 @@ import {
|
||||
pascalize,
|
||||
removeExt,
|
||||
getVantConfig,
|
||||
smartOutputFile
|
||||
smartOutputFile,
|
||||
normalizePath
|
||||
} from '../common';
|
||||
import {
|
||||
SRC_DIR,
|
||||
@@ -65,19 +66,19 @@ function resolveDocuments(components: string[]): DocumentItem[] {
|
||||
}
|
||||
|
||||
const staticDocs = glob.sync(join(DOCS_DIR, '**/*.md')).map(path => {
|
||||
const pairs = parse(path).name.split('.');
|
||||
const pairs = parse(path.toString()).name.split('.');
|
||||
return {
|
||||
name: formatName(pairs[0], pairs[1] || defaultLang),
|
||||
path
|
||||
};
|
||||
});
|
||||
|
||||
return [...staticDocs, ...docs.filter(item => existsSync(item.path))];
|
||||
return [...staticDocs, ...docs.filter(item => existsSync(item.path))] as DocumentItem[];
|
||||
}
|
||||
|
||||
function genImportDocuments(items: DocumentItem[]) {
|
||||
return items
|
||||
.map(item => `import ${item.name} from '${item.path}';`)
|
||||
.map(item => `import ${item.name} from '${normalizePath(item.path)}';`)
|
||||
.join('\n');
|
||||
}
|
||||
|
||||
@@ -88,7 +89,7 @@ function genExportDocuments(items: DocumentItem[]) {
|
||||
}
|
||||
|
||||
function genImportConfig() {
|
||||
return `import config from '${removeExt(VANT_CONFIG_FILE)}';`;
|
||||
return `import config from '${removeExt(normalizePath(VANT_CONFIG_FILE))}';`;
|
||||
}
|
||||
|
||||
function genExportConfig() {
|
||||
|
Reference in New Issue
Block a user