From cd73dfdbcbdd9a8863a3b3bd75d6af1e1899ee1d Mon Sep 17 00:00:00 2001 From: THORSTEN SCHMINKEL Date: Sun, 11 Feb 2024 10:38:52 +0100 Subject: [PATCH] Update base path using environment variable in vite.config --- .example.env | 1 + vite.config.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .example.env diff --git a/.example.env b/.example.env new file mode 100644 index 0000000..521edb2 --- /dev/null +++ b/.example.env @@ -0,0 +1 @@ +BASE_PATH=/react-shopping-cart-client-only/ diff --git a/vite.config.js b/vite.config.js index 164e916..c8d809b 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,6 +3,6 @@ import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ - base: "/react-shopping-cart-client-only/", + base: import.meta.env.BASE_PATH, plugins: [react()], })