Skip to content

Commit

Permalink
fix(webpack-box): 降低复杂度
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxue committed Dec 24, 2019
1 parent 4c258e7 commit 907ef27
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
### 📝 文档
范围|描述|commitId
--|--|--
贡献者 | 贡献者名单| [f973cae](https://github.com/luoxue-victor/learn_webpack/commit/f973cae) 开发 | 开发文档| [c04320d](https://github.com/luoxue-victor/learn_webpack/commit/c04320d) readme | 贡献者名单| [19dd193](https://github.com/luoxue-victor/learn_webpack/commit/19dd193) readme | 开发指南| [7021d5d](https://github.com/luoxue-victor/learn_webpack/commit/7021d5d) readme | 修改课时25文档| [8a903d7](https://github.com/luoxue-victor/learn_webpack/commit/8a903d7)
插件文档 | 编写开发插件文档| [4c258e7](https://github.com/luoxue-victor/learn_webpack/commit/4c258e7) 贡献者 | 贡献者名单| [f973cae](https://github.com/luoxue-victor/learn_webpack/commit/f973cae) 开发 | 开发文档| [c04320d](https://github.com/luoxue-victor/learn_webpack/commit/c04320d) readme | 贡献者名单| [19dd193](https://github.com/luoxue-victor/learn_webpack/commit/19dd193) readme | 开发指南| [7021d5d](https://github.com/luoxue-victor/learn_webpack/commit/7021d5d) readme | 修改课时25文档| [8a903d7](https://github.com/luoxue-victor/learn_webpack/commit/8a903d7)
## [1.2.3](https://github.com/luoxue-victor/learn_webpack/compare/v1.2.2...v1.2.3) (2019-12-24)

范围|描述|commitId
Expand Down
22 changes: 0 additions & 22 deletions packages/webpack-box/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
const fs = require('fs')
const join = require('path').join
/**
* @param startPath 起始目录文件夹路径
* @returns {Array}
*/
function findSync(startPath) {
const result = []
function finder(path) {
const files = fs.readdirSync(path)
files.forEach((val, index) => {
const fPath = join(path, val)
const stats = fs.statSync(fPath)
if (stats.isDirectory()) finder(fPath)
if (stats.isFile()) result.push(fPath)
})
}
finder(join(__dirname, startPath))
return result
}

function cleanArgs(cmd) {
const args = {}
cmd.options.forEach(o => {
Expand All @@ -34,5 +13,4 @@ function camelize(str) {
return str.replace(/-(\w)/g, (_, c) => c ? c.toUpperCase() : '')
}

exports.findSync = findSync
exports.cleanArgs = cleanArgs

0 comments on commit 907ef27

Please sign in to comment.