build: update get-components.js (#4859)

This commit is contained in:
neverland 2019-10-28 17:08:47 +08:00 committed by GitHub
parent 8b493aa925
commit cc3d53b2fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,16 +1,10 @@
const fs = require('fs');
const path = require('path');
const excludes = [
'index.ts',
'index.less',
'style',
'mixins',
'utils',
'.DS_Store'
];
const EXCLUDES = ['index.ts', 'index.less', 'style', 'mixins', 'utils', '.DS_Store'];
module.exports = function () {
const dirs = fs.readdirSync(path.resolve(__dirname, '../src'));
return dirs.filter(dirName => excludes.indexOf(dirName) === -1);
module.exports = function() {
const src = path.resolve(__dirname, '../src');
const dirs = fs.readdirSync(src);
return dirs.filter(dir => !EXCLUDES.includes(dir));
};