From cc3d53b2febe77cc15700e0a43a36e8fbcc00c3b Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 28 Oct 2019 17:08:47 +0800 Subject: [PATCH] build: update get-components.js (#4859) --- build/get-components.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/build/get-components.js b/build/get-components.js index 6e7da530e..69ff9d3db 100644 --- a/build/get-components.js +++ b/build/get-components.js @@ -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)); };