From 3d5da901025a21dd882f2b22ba79292a59d67a8e Mon Sep 17 00:00:00 2001 From: Alexei Moisseev Date: Mon, 10 Oct 2022 16:55:25 +0300 Subject: [PATCH] Read app base URL from env var (#165) --- .env.example | 2 ++ src/index.html | 6 +++--- webpack.config.js | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 467f0efd3..6c3719e12 100644 --- a/.env.example +++ b/.env.example @@ -2,3 +2,5 @@ NODE_ENV=development TELEGRAM_T_API_ID= TELEGRAM_T_API_HASH= + +BASE_URL=https://web.telegram.org/z/ diff --git a/src/index.html b/src/index.html index 65d1053ae..0179f75ce 100644 --- a/src/index.html +++ b/src/index.html @@ -21,19 +21,19 @@ - + - + - + diff --git a/webpack.config.js b/webpack.config.js index c0eb41bcf..7b5a16466 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -23,6 +23,8 @@ const { dotenv.config(); +const { BASE_URL = 'https://web.telegram.org/z/' } = process.env; + module.exports = (_env, { mode = 'production' }) => { return { mode, @@ -145,6 +147,7 @@ module.exports = (_env, { mode = 'production' }) => { appleIcon: APP_ENV === 'production' ? 'apple-touch-icon' : 'apple-touch-icon-dev', mainIcon: APP_ENV === 'production' ? 'icon-192x192' : 'icon-dev-192x192', manifest: APP_ENV === 'production' ? 'site.webmanifest' : 'site_dev.webmanifest', + baseUrl: BASE_URL, template: 'src/index.html', }), new MiniCssExtractPlugin({