mirror of
https://gitee.com/bootx/dax-pay-ui.git
synced 2025-09-09 05:29:32 +00:00
chore: detail optimization
This commit is contained in:
@@ -74,9 +74,7 @@ function injectCdnjs(html: string) {
|
||||
export async function runUpdateHtml() {
|
||||
const outDir = viteConfig.outDir || 'dist';
|
||||
const indexPath = getCwdPath(outDir, 'index.html');
|
||||
if (!existsSync(`${indexPath}`)) {
|
||||
return;
|
||||
}
|
||||
if (!existsSync(indexPath)) return;
|
||||
try {
|
||||
let processedHtml = '';
|
||||
const rawHtml = readFileSync(indexPath, 'utf-8');
|
||||
@@ -92,7 +90,9 @@ export async function runUpdateHtml() {
|
||||
}
|
||||
if (minify) {
|
||||
const { enable, ...miniOpt } = minify;
|
||||
processedHtml = HtmlMinifier.minify(processedHtml, miniOpt);
|
||||
if (enable) {
|
||||
processedHtml = HtmlMinifier.minify(processedHtml, miniOpt);
|
||||
}
|
||||
}
|
||||
|
||||
writeFileSync(indexPath, processedHtml);
|
||||
|
Reference in New Issue
Block a user