2021-02-03 17:09:12 +08:00
|
|
|
const fs = require('fs').promises
|
2021-02-03 11:32:40 +08:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
2021-02-03 20:20:00 +08:00
|
|
|
|
2021-02-03 21:38:43 +08:00
|
|
|
exports.outDirs = ['es', 'lib'].map((d) => path.resolve(__dirname, '../..', d))
|
2021-06-02 12:58:18 +08:00
|
|
|
exports.srcDir = path.resolve(__dirname, '../../src')
|
|
|
|
|
|
|
|
exports.replaceDefine = require('./replace-define').replaceDefine
|