You've already forked Nano-Banana-AI-Image-Editor
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import * as path from 'path';
|
|
|
|
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import * as path from 'path';
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
base: './', // 添加这行以确保资源路径正确
|
|
publicDir: path.resolve(__dirname, 'public'), // 使用绝对路径指定 public 目录
|
|
plugins: [react()],
|
|
optimizeDeps: {
|
|
exclude: ['lucide-react'],
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'react-day-picker/dist/locale/zh-CN': 'date-fns/locale/zh-CN',
|
|
'react-day-picker/dist/locale': 'date-fns/locale',
|
|
'react-day-picker/locale': 'date-fns/locale',
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
assetsDir: 'assets',
|
|
rollupOptions: {
|
|
output: {
|
|
entryFileNames: 'assets/[name].[hash].js',
|
|
chunkFileNames: 'assets/[name].[hash].js',
|
|
assetFileNames: 'assets/[name].[hash].[ext]',
|
|
},
|
|
},
|
|
// 确保 public 目录下的文件被复制到 dist 目录
|
|
copyPublicDir: true,
|
|
},
|
|
define: {
|
|
'import.meta.env.VITE_DEV_SERVER_URL': JSON.stringify(process.env.VITE_DEV_SERVER_URL),
|
|
},
|
|
}); |