diff --git a/front/index.html b/front/index.html index 07732877..a7cf811c 100644 --- a/front/index.html +++ b/front/index.html @@ -27,7 +27,6 @@ - diff --git a/front/package.json b/front/package.json index c1e4708b..28965b26 100644 --- a/front/package.json +++ b/front/package.json @@ -4,6 +4,7 @@ "main": "index.js", "license": "SEE LICENSE IN LICENSE.txt", "devDependencies": { + "@geprog/vite-plugin-env-config": "^3.0.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.36", "@tsconfig/svelte": "^1.0.10", "@types/google-protobuf": "^3.7.3", diff --git a/front/public/env-config.template.js b/front/public/env-config.template.js deleted file mode 100644 index e672d7aa..00000000 --- a/front/public/env-config.template.js +++ /dev/null @@ -1,27 +0,0 @@ -window.env = { - SKIP_RENDER_OPTIMIZATIONS: '${SKIP_RENDER_OPTIMIZATIONS}', - DISABLE_NOTIFICATIONS: '${DISABLE_NOTIFICATIONS}', - PUSHER_URL: '${PUSHER_URL}', - UPLOADER_URL: '${UPLOADER_URL}', - ADMIN_URL: '${ADMIN_URL}', - CONTACT_URL: '${CONTACT_URL}', - PROFILE_URL: '${PROFILE_URL}', - ICON_URL: '${ICON_URL}', - DEBUG_MODE: '${DEBUG_MODE}', - STUN_SERVER: '${STUN_SERVER}', - TURN_SERVER: '${TURN_SERVER}', - TURN_USER: '${TURN_USER}', - TURN_PASSWORD: '${TURN_PASSWORD}', - JITSI_URL: '${JITSI_URL}', - JITSI_PRIVATE_MODE: '${JITSI_PRIVATE_MODE}', - START_ROOM_URL: '${START_ROOM_URL}', - MAX_USERNAME_LENGTH: '${MAX_USERNAME_LENGTH}', - MAX_PER_GROUP: '${MAX_PER_GROUP}', - DISPLAY_TERMS_OF_USE: '${DISPLAY_TERMS_OF_USE}', - POSTHOG_API_KEY: '${POSTHOG_API_KEY}', - POSTHOG_URL: '${POSTHOG_URL}', - NODE_ENV: '${NODE_ENV}', - DISABLE_ANONYMOUS: '${DISABLE_ANONYMOUS}', - OPID_LOGIN_SCREEN_PROVIDER: '${OPID_LOGIN_SCREEN_PROVIDER}', - FALLBACK_LOCALE: '${FALLBACK_LOCALE}', -}; diff --git a/front/vite.config.ts b/front/vite.config.ts index 7b2a217d..fc8c20f5 100644 --- a/front/vite.config.ts +++ b/front/vite.config.ts @@ -1,6 +1,38 @@ import { defineConfig } from "vite"; import { svelte } from "@sveltejs/vite-plugin-svelte"; +import { envConfig } from "@geprog/vite-plugin-env-config"; export default defineConfig({ - plugins: [svelte({})], + plugins: [ + svelte({}), + envConfig({ + variables: [ + "SKIP_RENDER_OPTIMIZATIONS", + "DISABLE_NOTIFICATIONS", + "PUSHER_URL", + "UPLOADER_URL", + "ADMIN_URL", + "CONTACT_URL", + "PROFILE_URL", + "ICON_URL", + "DEBUG_MODE", + "STUN_SERVER", + "TURN_SERVER", + "TURN_USER", + "TURN_PASSWORD", + "JITSI_URL", + "JITSI_PRIVATE_MODE", + "START_ROOM_URL", + "MAX_USERNAME_LENGTH", + "MAX_PER_GROUP", + "DISPLAY_TERMS_OF_USE", + "POSTHOG_API_KEY", + "POSTHOG_URL", + "NODE_ENV", + "DISABLE_ANONYMOUS", + "OPID_LOGIN_SCREEN_PROVIDER", + "FALLBACK_LOCALE", + ], + }), + ], }); diff --git a/front/yarn.lock b/front/yarn.lock index 02c1e911..05ec0c35 100644 --- a/front/yarn.lock +++ b/front/yarn.lock @@ -93,6 +93,11 @@ dependencies: "@fortawesome/fontawesome-common-types" "^0.2.35" +"@geprog/vite-plugin-env-config@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@geprog/vite-plugin-env-config/-/vite-plugin-env-config-3.0.0.tgz#b16e57ad16429be7d73d19f13b5b529a78e7f9fa" + integrity sha512-ocIPodgIZAJm+h6As20IB8s5RLV85wvlnXNRFU2oI1owbBLqDjzSleY9+6Ey0abGSu0MNXlJQZL5ApSg6L5qCg== + "@humanwhocodes/config-array@^0.9.2": version "0.9.2" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.2.tgz#68be55c737023009dfc5fe245d51181bb6476914"