update basename

This commit is contained in:
2025-10-18 00:45:18 +08:00
parent 27229a4335
commit a32bf6f3d7
3 changed files with 22 additions and 18 deletions

View File

@@ -4,7 +4,6 @@ import react from '@astrojs/react';
import sitemap from '@astrojs/sitemap';
import pkgs from './package.json';
import tailwindcss from '@tailwindcss/vite';
const isDev = process.env.NODE_ENV === 'development';
let target = process.env.VITE_API_URL || 'https://localhost:51015';
@@ -16,17 +15,22 @@ let proxy = {
'/api': apiProxy,
};
const basename = isDev ? undefined : `${pkgs.basename}`;
export default defineConfig({
base: isDev ? undefined : pkgs.basename,
base: basename,
integrations: [
mdx(),
react(), //
// sitemap(), // sitemap must be site has a domain
],
vite: {
plugins: [tailwindcss()],
define: {
basename: JSON.stringify(basename || ''),
},
server: {
https: true,
port: 7008,
host: '0.0.0.0',
allowedHosts: true,