naive-ui/scripts/gen-css-vars-dts.js
2024-07-12 02:19:13 +08:00

16 lines
429 B
JavaScript

const fs = require('node:fs').promises
const path = require('node:path')
const { genDts, collectVars } = require('./utils/collect-vars')
const { walk } = require('./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)
}
}
})()