fix: platform env var
NATIVE vs WEB
This commit is contained in:
@@ -23,4 +23,4 @@ export interface OLAPEngine {
|
||||
getSchema(): Promise<Table[]>;
|
||||
}
|
||||
|
||||
export const engine: OLAPEngine = FORCE_REMOTE_ENGINE ? new RemoteEngine() : new CHDBEngine();
|
||||
export const engine: OLAPEngine = PLATFORM === 'WEB' ? new RemoteEngine() : new CHDBEngine();
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
set_app_context({ context_menu });
|
||||
|
||||
let screen_width = $state(0);
|
||||
let is_mobile = $derived(screen_width < 768 && WEB_APP);
|
||||
let is_mobile = $derived(screen_width < 768 && PLATFORM === 'WEB');
|
||||
let open_drawer = $state(false);
|
||||
|
||||
$effect(() => {
|
||||
|
||||
3
src/vite-env.d.ts
vendored
3
src/vite-env.d.ts
vendored
@@ -1,4 +1,3 @@
|
||||
declare const FORCE_REMOTE_ENGINE: boolean;
|
||||
declare const WEB_APP: boolean;
|
||||
declare const PLATFORM: 'NATIVE' | 'WEB';
|
||||
|
||||
type MaybePromise<T> = T | Promise<T>;
|
||||
|
||||
@@ -22,7 +22,6 @@ export default defineConfig(async () => ({
|
||||
exclude: ['@sqlite.org/sqlite-wasm']
|
||||
},
|
||||
define: {
|
||||
FORCE_REMOTE_ENGINE: process.env.FORCE_REMOTE_ENGINE === 'true',
|
||||
WEB_APP: process.env.WEB_APP === 'true'
|
||||
PLATFORM: JSON.stringify(process.env.PLATFORM || 'NATIVE')
|
||||
}
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user