From 54cedb28182f249d4fa4c59c66cac2cde44cae83 Mon Sep 17 00:00:00 2001 From: Guntis Smaukstelis Date: Thu, 18 May 2023 16:39:14 +0300 Subject: [PATCH] Indicate in web title that working in dev environment --- web/.env.development | 1 + web/.env.production | 1 + web/index.html | 2 +- web/package-lock.json | 20 ++++++++++++++++++++ web/package.json | 1 + web/vite.config.ts | 3 ++- 6 files changed, 26 insertions(+), 2 deletions(-) diff --git a/web/.env.development b/web/.env.development index abf41e8..0075fe7 100644 --- a/web/.env.development +++ b/web/.env.development @@ -1 +1,2 @@ +VITE_APP_TITLE="[dev] Weather Tool" VITE_API_HOST=http://0.0.0.0:8080 diff --git a/web/.env.production b/web/.env.production index 602ea08..189585c 100644 --- a/web/.env.production +++ b/web/.env.production @@ -1 +1,2 @@ +VITE_APP_TITLE="Weather Tool" VITE_API_HOST=https://weather-tool.fly.dev \ No newline at end of file diff --git a/web/index.html b/web/index.html index 6d1431b..d7f09bc 100644 --- a/web/index.html +++ b/web/index.html @@ -5,7 +5,7 @@ - Weather Tool + <{ VITE_APP_TITLE }> diff --git a/web/package-lock.json b/web/package-lock.json index 5a4a4da..9c84ea4 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -14,6 +14,7 @@ "devDependencies": { "typescript": "^4.9.5", "vite": "^4.1.1", + "vite-plugin-html-env": "^1.2.8", "vite-plugin-solid": "^2.5.0" } }, @@ -1534,6 +1535,18 @@ } } }, + "node_modules/vite-plugin-html-env": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/vite-plugin-html-env/-/vite-plugin-html-env-1.2.8.tgz", + "integrity": "sha512-Uqo2NqcmhVjuXv83oyRC80mZF+B2J3pcon8Bnm9F3T67EvkPYf64Gk0NReAE4MRGElt8pCGpCMQDIzs12NWUAA==", + "dev": true, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "vite": "*" + } + }, "node_modules/vite-plugin-solid": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/vite-plugin-solid/-/vite-plugin-solid-2.7.0.tgz", @@ -2533,6 +2546,13 @@ "rollup": "^3.21.0" } }, + "vite-plugin-html-env": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/vite-plugin-html-env/-/vite-plugin-html-env-1.2.8.tgz", + "integrity": "sha512-Uqo2NqcmhVjuXv83oyRC80mZF+B2J3pcon8Bnm9F3T67EvkPYf64Gk0NReAE4MRGElt8pCGpCMQDIzs12NWUAA==", + "dev": true, + "requires": {} + }, "vite-plugin-solid": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/vite-plugin-solid/-/vite-plugin-solid-2.7.0.tgz", diff --git a/web/package.json b/web/package.json index 86933af..4e831fa 100644 --- a/web/package.json +++ b/web/package.json @@ -11,6 +11,7 @@ "devDependencies": { "typescript": "^4.9.5", "vite": "^4.1.1", + "vite-plugin-html-env": "^1.2.8", "vite-plugin-solid": "^2.5.0" }, "dependencies": { diff --git a/web/vite.config.ts b/web/vite.config.ts index 9ff59a1..457f5ca 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -1,8 +1,9 @@ import { defineConfig } from 'vite'; +import VitePluginHtmlEnv from 'vite-plugin-html-env' import solidPlugin from 'vite-plugin-solid'; export default defineConfig({ - plugins: [solidPlugin()], + plugins: [solidPlugin(), VitePluginHtmlEnv()], server: { port: 3000, },