From 70ec2e9954b9941efd27c4f36dbe57255616edc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hl=C3=B6=C3=B0ver=20Sigur=C3=B0sson?= Date: Tue, 10 Dec 2024 10:40:55 +0200 Subject: [PATCH] fix: env-var passing and output folder name --- .github/workflows/develop.yaml | 2 +- .github/workflows/production.yaml | 2 +- .gitignore | 1 + package.json | 1 - vite.config.ts | 7 +++++-- yarn.lock | 5 ----- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/develop.yaml b/.github/workflows/develop.yaml index ba3401df..ec0f69bd 100644 --- a/.github/workflows/develop.yaml +++ b/.github/workflows/develop.yaml @@ -20,7 +20,7 @@ jobs: run: | yarn install PUBLIC_URL="https://csound-ide-dev.web.app" yarn build:dev - cp build/index.html functions + cp dist/index.html functions cd functions yarn install yarn build diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml index c0bc9ab1..480a239b 100644 --- a/.github/workflows/production.yaml +++ b/.github/workflows/production.yaml @@ -16,7 +16,7 @@ jobs: run: | yarn install PUBLIC_URL="https://ide.csound.com" PRODUCTION=1 yarn build - cp build/index.html functions + cp dist/index.html functions cd functions yarn install yarn build diff --git a/.gitignore b/.gitignore index 13fa43a3..8d4b6601 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ firebase-debug.log # production /build +dist # misc .DS_Store diff --git a/package.json b/package.json index 8c8992c4..7fc1bbbe 100644 --- a/package.json +++ b/package.json @@ -165,7 +165,6 @@ "url-loader": "4.1.1", "uuid": "^11.0.3", "vite-plugin-checker": "^0.8.0", - "vite-plugin-environment": "^1.1.3", "vite-plugin-svgr": "^4.3.0", "webpack": "5.97.1", "webpack-cli": "^5.1.4", diff --git a/vite.config.ts b/vite.config.ts index 52f8d1f3..f06d722b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,11 +2,15 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import viteTsconfigPaths from "vite-tsconfig-paths"; import svgr from "vite-plugin-svgr"; -import EnvironmentPlugin from "vite-plugin-environment"; import checker from "vite-plugin-checker"; import viteRawPlugin from "vite-raw-plugin"; export default defineConfig({ + define: { + "process.env.REACT_APP_DATABASE": JSON.stringify( + process.env.REACT_APP_DATABASE + ) + }, // depending on your application, base can also be "/" base: "", plugins: [ @@ -22,7 +26,6 @@ export default defineConfig({ }), viteTsconfigPaths(), svgr(), - EnvironmentPlugin(["REACT_APP_DATABASE"]), viteRawPlugin({ fileRegex: /\.csd|\.orc\.sco\.udo$/ }) diff --git a/yarn.lock b/yarn.lock index 14bb0312..6670f77b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17616,11 +17616,6 @@ vite-plugin-checker@^0.8.0: vscode-languageserver-textdocument "^1.0.1" vscode-uri "^3.0.2" -vite-plugin-environment@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/vite-plugin-environment/-/vite-plugin-environment-1.1.3.tgz#d01a04abb2f69730a4866c9c9db51d3dab74645b" - integrity sha512-9LBhB0lx+2lXVBEWxFZC+WO7PKEyE/ykJ7EPWCq95NEcCpblxamTbs5Dm3DLBGzwODpJMEnzQywJU8fw6XGGGA== - vite-plugin-svgr@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/vite-plugin-svgr/-/vite-plugin-svgr-4.3.0.tgz#742f16f11375996306c696ec323e4d23f6005075"