-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[explorer] Remove targeted builds for explorer (#4631)
* Remove targeted builds for explorer * Fix targeted builds for static * Support unit tests * Update docs + remove dev:local command * Update explorer/client/README.md Co-authored-by: Randall-Mysten <109545725+randall-Mysten@users.noreply.github.com> * Use prod instead of dev * Lint fix Co-authored-by: Randall-Mysten <109545725+randall-Mysten@users.noreply.github.com>
- Loading branch information
1 parent
2a03a5c
commit 68140e8
Showing
10 changed files
with
42 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
// Copyright (c) 2022, Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export const IS_STATIC_ENV = import.meta.env.VITE_NETWORK === 'static'; | ||
export const IS_LOCAL_ENV = import.meta.env.VITE_NETWORK === 'local'; | ||
export const IS_STAGING_ENV = import.meta.env.VITE_NETWORK === 'staging'; | ||
export const IS_PROD_ENV = import.meta.env.VITE_NETWORK === 'prod'; | ||
import { Network } from './api/rpcSetting'; | ||
|
||
export const CURRENT_ENV = import.meta.env.VITE_NETWORK; | ||
const HOST_TO_NETWORK: Record<string, Network> = { | ||
ci: Network.CI, | ||
staging: Network.Staging, | ||
devnet: Network.Devnet, | ||
static: Network.Static, | ||
}; | ||
|
||
export let CURRENT_ENV: Network = Network.Local; | ||
if (import.meta.env.VITE_NETWORK) { | ||
CURRENT_ENV = HOST_TO_NETWORK[import.meta.env.VITE_NETWORK]; | ||
} else if ( | ||
typeof window !== 'undefined' && | ||
window.location.hostname.includes('.sui.io') | ||
) { | ||
const host = window.location.hostname.split('.').at(-3) || 'devnet'; | ||
CURRENT_ENV = HOST_TO_NETWORK[host] || Network.Devnet; | ||
} | ||
|
||
export const IS_STATIC_ENV = CURRENT_ENV === Network.Static; | ||
export const IS_STAGING_ENV = CURRENT_ENV === Network.Staging; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters