mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
19 lines
456 B
JavaScript
19 lines
456 B
JavaScript
const fs = require('fs').promises
|
|
const terseCssr = require('../../build/utils/terse-cssr.js')
|
|
const { walk, outDirs } = require('../utils')
|
|
|
|
exports.terseCssr = async () => {
|
|
for (const dir of outDirs) {
|
|
for await (const p of walk(dir)) {
|
|
if (p.includes('.cssr.js')) {
|
|
const code = await fs.readFile(p, 'utf-8')
|
|
await fs.writeFile(p, terseCssr(code))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (require.main === module) {
|
|
exports.terseCssr()
|
|
}
|