naive-ui/scripts/generate-global-style.js
2020-09-08 13:52:03 +08:00

28 lines
551 B
JavaScript

const fs = require('fs').promises
const path = require('path')
function generateCssr (literal) {
return `export default \`${literal}\`\n`
}
;(async () => {
const file = await fs.readFile(
path.resolve(
__dirname,
'..',
'node_modules',
'vue-virtual-scroller',
'dist',
'vue-virtual-scroller.css'
)
)
const cssLiteral = file.toString()
await fs.writeFile(path.resolve(
__dirname,
'..',
'src',
'_global-style/',
'vue-virtual-scroller.cssr.js'
), generateCssr(cssLiteral))
})()