chore: lazy import and saas build base url

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-12-05 00:34:40 +08:00
parent 1507b695c2
commit 84128e8668
3 changed files with 8 additions and 1 deletions

View File

@@ -9,6 +9,7 @@
},
"scripts": {
"build": "vite build",
"build:prod:saas": "SAAS=1 vite build",
"dev": "vite",
"format": "prettier --write \"src/**/*.ts\" ",
"lint": "eslint --fix",
@@ -108,4 +109,4 @@
"eslint --fix"
]
}
}
}

View File

@@ -3,6 +3,9 @@ import { Outlet } from 'react-router'
import { Header } from '~/components/common/Header'
Object.entries(import.meta.glob('./**/*.tsx', { eager: false })).forEach(([_, importer]) => {
importer()
})
export function Component() {
return (
<div className="flex h-screen flex-col">

View File

@@ -16,7 +16,10 @@ import PKG from './package.json'
const ROOT = fileURLToPath(new URL('./', import.meta.url))
const isSaas = process.env.SAAS === '1'
export default defineConfig({
base: isSaas ? 'https://static.afilmory.art/platform/' : '/',
plugins: [
codeInspectorPlugin({
bundler: 'vite',