mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-11-21 01:13:16 +08:00
16 lines
431 B
JavaScript
16 lines
431 B
JavaScript
const fs = require('fs').promises
|
|
const path = require('path')
|
|
const { genDts, collectVars } = require('./utils/collect-vars.js')
|
|
const { walk } = require('../scripts/utils')
|
|
|
|
const srcPath = path.resolve(__dirname, '..', 'src')
|
|
|
|
;(async () => {
|
|
for await (const p of walk(srcPath)) {
|
|
if (p.endsWith('.cssr.ts')) {
|
|
const dts = genDts(collectVars(await fs.readFile(p, 'utf-8')))
|
|
console.log(p, dts)
|
|
}
|
|
}
|
|
})()
|