You've already forked Nano-Banana-AI-Image-Editor
新增 现在支持编译为Windows桌面端
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
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'],
|
||||
@@ -14,4 +21,20 @@ export default defineConfig({
|
||||
'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),
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user