UNPKG

bixi

Version:

企业级中后台前端解决方案

27 lines (20 loc) 746 B
#!/usr/bin/env node const fs = require('fs'); const path = require('path'); const lessToJs = require('less-vars-to-js'); function gen(type) { const ngZorroAntdStylePath = path.join(__dirname, '../../node_modules/ng-zorro-antd/style'); const ngZorro = ` ${fs.readFileSync(path.join(ngZorroAntdStylePath, 'color', 'colors.less'), 'utf8')} ${fs.readFileSync(path.join(ngZorroAntdStylePath, 'themes', `${type}.less`), 'utf8')} `; const lessPath = path.join(__dirname, '../../packages'); const typeLess = fs.readFileSync(path.join(lessPath, 'core', 'style', `${type}.less`), 'utf8'); return lessToJs(`${ngZorro}${typeLess}`, { stripPrefix: true, resolveVariables: false, }); } module.exports = { dark: gen('dark') };