mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
16 lines
489 B
JavaScript
16 lines
489 B
JavaScript
const fs = require('fs').promises
|
|
const path = require('path')
|
|
|
|
exports.walk = async function * walk (dir) {
|
|
for await (const d of await fs.opendir(dir)) {
|
|
const entry = path.join(dir, d.name)
|
|
if (d.isDirectory()) yield * walk(entry)
|
|
else if (d.isFile()) yield entry
|
|
}
|
|
}
|
|
|
|
exports.outDirs = ['es', 'lib'].map((d) => path.resolve(__dirname, '../..', d))
|
|
exports.srcDir = path.resolve(__dirname, '../../src')
|
|
|
|
exports.replaceDefine = require('./replace-define').replaceDefine
|