feat(layout): 调整基础布局结构与样式
Some checks failed
CI/CD Pipeline / playwright (push) Successful in 4m30s
CI/CD Pipeline / build-and-deploy (push) Has been cancelled

This commit is contained in:
严浩
2025-10-23 23:06:37 +08:00
parent 51ae1ad017
commit 7d2d4675fc
8 changed files with 8 additions and 13 deletions

View File

@@ -0,0 +1,28 @@
import type { PluginOption } from 'vite';
import { minify as minifyHtml } from 'html-minifier-terser';
function IndexHtmlPlugin(): PluginOption {
return {
name: 'index-html-plugin',
apply: 'build',
async transformIndexHtml(html) {
console.time('minifyHtml');
// 压缩 HTML
const minifiedHtml = await minifyHtml(html, {
collapseWhitespace: true,
removeComments: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
useShortDoctype: true,
minifyCSS: true,
minifyJS: true,
});
console.log();
console.timeEnd('minifyHtml');
return minifiedHtml;
},
};
}
export default [IndexHtmlPlugin()] satisfies PluginOption[];