fix: import-meta-env crashes while using dev mode

This commit is contained in:
Andrew Bastin
2023-08-24 09:43:52 +05:30
parent efa40cf6ea
commit d09a3e9237
2 changed files with 12 additions and 8 deletions

View File

@@ -242,9 +242,11 @@ export default defineConfig({
modernPolyfills: ["es.string.replace-all"], modernPolyfills: ["es.string.replace-all"],
renderLegacyChunks: false, renderLegacyChunks: false,
}), }),
ImportMetaEnv.vite({ process.env.HOPP_ALLOW_RUNTIME_ENV
? ImportMetaEnv.vite({
example: "../../.env.example", example: "../../.env.example",
env: "../../.env", env: "../../.env",
}), })
: [],
], ],
}) })

View File

@@ -91,9 +91,11 @@ export default defineConfig({
], ],
} }
}), }),
ImportMetaEnv.vite({ process.env.HOPP_ALLOW_RUNTIME_ENV
? ImportMetaEnv.vite({
example: "../../.env.example", example: "../../.env.example",
env: "../../.env", env: "../../.env",
}), })
: [],
], ],
}); });