diff --git a/packages/demo-wallet/src/config/env_selector.ts b/packages/demo-wallet/src/config/env_selector.ts new file mode 100644 index 0000000..19ece03 --- /dev/null +++ b/packages/demo-wallet/src/config/env_selector.ts @@ -0,0 +1,2 @@ +// support the env var style for both Vite and Parcel +export const env = import.meta.env || process.env; diff --git a/packages/demo-wallet/src/config/snap.ts b/packages/demo-wallet/src/config/snap.ts index d68d406..c027949 100644 --- a/packages/demo-wallet/src/config/snap.ts +++ b/packages/demo-wallet/src/config/snap.ts @@ -1,3 +1,5 @@ +import { env } from './env_selector'; + export const defaultSnapOrigin = // eslint-disable-next-line no-restricted-globals - import.meta.env.SNAP_ORIGIN ?? `local:http://localhost:8080`; + env.SNAP_ORIGIN ?? `local:http://localhost:8080`;