feat: 更新项目代码

This commit is contained in:
2026-04-01 22:03:57 +08:00
parent 1c81d4e6ea
commit 284b5a5260
53 changed files with 6240 additions and 22665 deletions

View File

@@ -0,0 +1,32 @@
import { defineConfig, transformWithEsbuild } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
plugins: [
// Allow JSX in .js files (all files under src/)
{
name: 'treat-js-as-jsx',
async transform(code, id) {
if (!id.match(/\/src\/.*\.js$/)) return null;
return transformWithEsbuild(code, id, { loader: 'jsx' });
},
},
react({ include: '**/*.{jsx,js}' }),
tailwindcss(),
],
resolve: {
alias: { '@': path.resolve(__dirname, './src') },
},
base: '/',
server: { port: 3000 },
optimizeDeps: {
esbuildOptions: {
loader: { '.js': 'jsx' },
},
},
});