naive-ui/scripts/gen-css-vars-dts.js

16 lines
419 B
JavaScript
Raw Normal View History

2021-02-03 17:09:12 +08:00
const fs = require('fs').promises
const path = require('path')
2021-02-03 21:38:43 +08:00
const { genDts, collectVars } = require('./utils/collect-vars')
const { walk } = require('./utils')
2021-02-03 17:09:12 +08:00
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)
}
}
})()