mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 09:24:25 +00:00
chore: merge src and src-next
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
outputFileSync,
|
||||
} from 'fs-extra';
|
||||
import {
|
||||
ROOT,
|
||||
SRC_DIR,
|
||||
getVantConfig,
|
||||
ROOT_WEBPACK_CONFIG_FILE,
|
||||
@@ -36,10 +37,15 @@ export function hasDefaultExport(code: string) {
|
||||
export function getComponents() {
|
||||
const EXCLUDES = ['.DS_Store'];
|
||||
const dirs = readdirSync(SRC_DIR);
|
||||
|
||||
// TODO
|
||||
// whitelist for 3.0 development
|
||||
const whiteList = require(join(ROOT, 'components.js'));
|
||||
|
||||
return dirs
|
||||
.filter(dir => !EXCLUDES.includes(dir))
|
||||
.filter(dir =>
|
||||
ENTRY_EXTS.some(ext => {
|
||||
.filter((dir) => !EXCLUDES.includes(dir))
|
||||
.filter((dir) =>
|
||||
ENTRY_EXTS.some((ext) => {
|
||||
const path = join(SRC_DIR, dir, `index.${ext}`);
|
||||
if (existsSync(path)) {
|
||||
return hasDefaultExport(readFileSync(path, 'utf-8'));
|
||||
@@ -47,7 +53,8 @@ export function getComponents() {
|
||||
|
||||
return false;
|
||||
})
|
||||
);
|
||||
)
|
||||
.filter((dir) => whiteList.includes(dir));
|
||||
}
|
||||
|
||||
export function isDir(dir: string) {
|
||||
|
Reference in New Issue
Block a user