From 9c7e0895c4ab8cf3d21715bfd36852735299342c Mon Sep 17 00:00:00 2001 From: Mats Johansen Date: Wed, 12 Jun 2024 10:11:56 +0200 Subject: [PATCH] feat(options development): add option for dev path comment in for local development --- packages/demo/src/AppCCP.svelte | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/demo/src/AppCCP.svelte b/packages/demo/src/AppCCP.svelte index 5cd13fe..a48a74e 100644 --- a/packages/demo/src/AppCCP.svelte +++ b/packages/demo/src/AppCCP.svelte @@ -23,10 +23,16 @@ }); // VITE_TARGET_ENVIRONMENT should be set by the ci pipeline - const optionsFilePath = - import.meta.env.VITE_TARGET_ENVIRONMENT === "production" - ? "options-ccp-prod.json" - : "options-ccp-demo.json"; + let optionsFilePath: string = ""; + + if (import.meta.env.VITE_TARGET_ENVIRONMENT === "production") { + optionsFilePath = "options-ccp-prod.json"; + } else if (import.meta.env.VITE_TARGET_ENVIRONMENT === "staging") { + optionsFilePath = "options-ccp-demo.json"; + } + + // comment in for development + // optionsFilePath = "options-dev.json"; fetch(optionsFilePath) .then((response) => response.json())