1 Star 0 Fork 0

梁献涛/maxun

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
vite.config.js 669 Bytes
Copy Edit Raw Blame History
amhsirak authored 2024-12-03 23:52 . feat: handle VITE_PUBLIC_URL
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import dotenv from 'dotenv';
dotenv.config();
export default defineConfig(() => {
const publicUrl = process.env.VITE_PUBLIC_URL || 'http://localhost:5173';
return {
define: {
'import.meta.env.VITE_BACKEND_URL': JSON.stringify(process.env.VITE_BACKEND_URL),
'import.meta.env.VITE_PUBLIC_URL': JSON.stringify(publicUrl),
},
server: {
host: new URL(publicUrl).hostname,
port: parseInt(new URL(publicUrl).port),
},
build: {
outDir: 'build',
manifest: true,
chunkSizeWarningLimit: 1024,
},
plugins: [react()],
};
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liang-xiant/maxun.git
git@gitee.com:liang-xiant/maxun.git
liang-xiant
maxun
maxun
master

Search