feat: updated frontend docker containers to allow for runtime environment variable definitions

This commit is contained in:
Andrew Bastin
2023-07-14 16:43:38 +05:30
parent 6454d83486
commit 1b1a09c675
24 changed files with 466 additions and 70 deletions

View File

@@ -17,8 +17,9 @@ import { FileSystemIconLoader } from "unplugin-icons/loaders"
import * as path from "path"
import Unfonts from "unplugin-fonts/vite"
import legacy from "@vitejs/plugin-legacy"
import ImportMetaEnv from "@import-meta-env/unplugin"
const ENV = loadEnv("development", path.resolve(__dirname, "../../"))
const ENV = loadEnv("development", path.resolve(__dirname, "../../"), ["APP_"])
export default defineConfig({
envDir: path.resolve(__dirname, "../../"),
@@ -78,14 +79,15 @@ export default defineConfig({
routeStyle: "nuxt",
dirs: "../hoppscotch-common/src/pages",
importMode: "async",
onRoutesGenerated: (routes) =>
onRoutesGenerated(routes) {
generateSitemap({
routes,
nuxtStyle: true,
allowRobots: true,
dest: ".sitemap-gen",
hostname: ENV.VITE_BASE_URL,
}),
})
}
}),
StaticCopy({
targets: [
@@ -239,5 +241,9 @@ export default defineConfig({
modernPolyfills: ["es.string.replace-all"],
renderLegacyChunks: false,
}),
ImportMetaEnv.vite({
example: "../../.env.example",
env: "../../.env",
}),
],
})