temp: 适配mac桌面

This commit is contained in:
2024-10-23 20:02:59 +08:00
parent 4e0e149f54
commit a6a47be45f
7 changed files with 107 additions and 11 deletions

View File

@@ -4,10 +4,23 @@ import tailwindcss from 'tailwindcss';
import autoprefixer from 'autoprefixer';
import path from 'path';
import nesting from 'tailwindcss/nesting';
const isDev = process.env.NODE_ENV === 'development';
const unamiPlugin = {
name: 'html-transform',
transformIndexHtml(html: string) {
return html.replace(
'</head>',
`<script defer src="https://umami.xiongxiao.me/script.js" data-website-id="aeea5ee5-df79-4e78-8c0d-a9f26db23695"></script></head>`,
);
},
};
const plugins = [];
if (!isDev) {
plugins.push(unamiPlugin);
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [react(), ...plugins],
css: {
postcss: {