quata模块完成

This commit is contained in:
‘Liammcl’
2024-12-22 23:20:20 +08:00
parent df0aa520ca
commit 98eb405cc5
14 changed files with 2822 additions and 609 deletions

View File

@@ -2,18 +2,30 @@ import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
// 使用 __dirname 需要添加 import.meta.url 的支持
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@': path.resolve(__dirname, 'src'),
'@components': path.resolve(__dirname, 'src/components'),
'@pages': path.resolve(__dirname, 'src/pages'),
'@utils': path.resolve(__dirname, 'src/utils'),
'@config': path.resolve(__dirname, 'src/config'),
'@contexts': path.resolve(__dirname, 'src/contexts'),
'@assets': path.resolve(__dirname, 'src/assets'),
},
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'] // 添加文件扩展名自动解析
},
server: {
port: 3000, // 设置开发服务器端口为 3000
open: true, // 自动打开浏览器
host: true, // 监听所有地址,包括局域网和公网地址
strictPort: true, // 如果端口被占用,直接退出
port: 3000,
open: true,
host: true,
strictPort: true,
},
build: {
outDir: 'dist',