mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-21 22:57:17 +01:00
fix(env-utils): connect build
This commit is contained in:
committed by
Jiri Zbytovsky
parent
1b26dbdd04
commit
3cc73bd8a4
@@ -3,14 +3,14 @@ const isWeb = () => process.env.SUITE_TYPE === 'web'; // duplicated with envUtil
|
||||
// This needs to be set as `.` so it loads from appDir of the Electron app.
|
||||
// For example (in case of AppImage): `file:///tmp/.mount_TrezorAvGo8g/resources/app.asar/build`,
|
||||
// where the requested asset (for example: `static/images/images/app-store-badge.svg`) is located.
|
||||
const DEFAULT_ASSET_PREFIX = isWeb() ? '' : '.';
|
||||
const getDefaultAssetPrefix = () => (isWeb() ? '' : '.');
|
||||
|
||||
export const resolveStaticPath = (
|
||||
path: string,
|
||||
pathPrefix: string | undefined = process.env.ASSET_PREFIX,
|
||||
) => `${pathPrefix || DEFAULT_ASSET_PREFIX}/static/${path.replace(/^\/+/, '')}`;
|
||||
) => `${pathPrefix || getDefaultAssetPrefix()}/static/${path.replace(/^\/+/, '')}`;
|
||||
|
||||
export const resolveConnectPath = (
|
||||
path: string,
|
||||
pathPrefix: string | undefined = process.env.ASSET_PREFIX,
|
||||
) => `${pathPrefix || DEFAULT_ASSET_PREFIX}/${path.replace(/^\/+/, '')}`;
|
||||
) => `${pathPrefix || getDefaultAssetPrefix()}/${path.replace(/^\/+/, '')}`;
|
||||
|
||||
Reference in New Issue
Block a user