mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
--------- Co-authored-by: Koy Zhuang <koy@ko8e24.top> Co-authored-by: sy-records <52o@qq52o.cn>
22 lines
511 B
JavaScript
22 lines
511 B
JavaScript
import path from 'path';
|
|
import fs from 'fs';
|
|
import cssnano from 'cssnano';
|
|
|
|
const files = fs
|
|
.readdirSync(path.resolve('lib/themes'))
|
|
.filter(file => !file.endsWith('min.css'));
|
|
|
|
files.forEach(file => {
|
|
file = path.resolve('lib/themes', file);
|
|
cssnano
|
|
.process(fs.readFileSync(file), { from: file })
|
|
.then(result => {
|
|
file = file.replace(/\.css$/, '.min.css');
|
|
fs.writeFileSync(file, result.css);
|
|
})
|
|
.catch(e => {
|
|
console.error(e);
|
|
process.exit(1);
|
|
});
|
|
});
|