fix(stage-tamagotchi,stage-shared): added isUrlMode define check

This commit is contained in:
Neko Ayaka
2025-10-25 01:33:40 +08:00
parent 13c144794b
commit 30f9985f53
3 changed files with 27 additions and 16 deletions
+12 -6
View File
@@ -73,13 +73,19 @@ export default defineConfig({
plugins: [
{
name: 'proj-airi:define-runtime-environment',
config() {
return {
define: {
'import.meta.env.RUNTIME_ENVIRONMENT': '\'electron\'',
},
name: 'proj-airi:defines',
config(ctx) {
const define: Record<string, any> = {
'import.meta.env.RUNTIME_ENVIRONMENT': '\'electron\'',
}
if (ctx.mode === 'development') {
define['import.meta.env.URL_MODE'] = '\'server\''
}
if (ctx.mode === 'production') {
define['import.meta.env.URL_MODE'] = '\'file\''
}
return { define }
},
},