mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
fix process vars
This commit is contained in:
parent
bdf151d7c7
commit
8d4b0d0f18
3
.gitignore
vendored
3
.gitignore
vendored
@ -10,6 +10,9 @@ pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
.cursor
|
||||
supabase/.temp/
|
||||
data
|
||||
scripts
|
||||
|
||||
|
||||
node_modules
|
||||
dist
|
||||
|
||||
@ -27,7 +27,7 @@ export interface OllamaApiResponse {
|
||||
models: OllamaModel[];
|
||||
}
|
||||
|
||||
export const DEFAULT_NUM_CTX = process?.env?.DEFAULT_NUM_CTX ? parseInt(process.env.DEFAULT_NUM_CTX, 10) : 32768;
|
||||
export const DEFAULT_NUM_CTX = import.meta.env.DEFAULT_NUM_CTX ? parseInt(import.meta.env.DEFAULT_NUM_CTX, 10) : 32768;
|
||||
|
||||
export default class OllamaProvider extends BaseProvider {
|
||||
name = 'Ollama';
|
||||
@ -101,7 +101,7 @@ export default class OllamaProvider extends BaseProvider {
|
||||
throw new Error('No baseUrl found for OLLAMA provider');
|
||||
}
|
||||
|
||||
const isDocker = process.env.RUNNING_IN_DOCKER === 'true';
|
||||
const isDocker = import.meta.env.RUNNING_IN_DOCKER === 'true';
|
||||
baseUrl = isDocker ? baseUrl.replace('localhost', 'host.docker.internal') : baseUrl;
|
||||
baseUrl = isDocker ? baseUrl.replace('127.0.0.1', 'host.docker.internal') : baseUrl;
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ export function shouldUseSupabase(): boolean {
|
||||
|
||||
// Check environment variables
|
||||
const useSupabaseFromEnv =
|
||||
typeof window !== 'undefined' ? window.ENV?.USE_SUPABASE === 'true' : process.env.USE_SUPABASE === 'true';
|
||||
typeof window === 'object' ? window.ENV?.USE_SUPABASE === 'true' : process.env.USE_SUPABASE === 'true';
|
||||
|
||||
// URL param takes precedence over environment variable
|
||||
const shouldUse = useSupabaseFromUrl || useSupabaseFromEnv;
|
||||
|
||||
17980
pnpm-lock.yaml
17980
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,6 @@ import { vitePlugin as remixVitePlugin } from '@remix-run/dev';
|
||||
import { vercelPreset } from '@vercel/remix/vite';
|
||||
import UnoCSS from 'unocss/vite';
|
||||
import { defineConfig, type ViteDevServer } from 'vite';
|
||||
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
||||
import { optimizeCssModules } from 'vite-plugin-optimize-css-modules';
|
||||
import { sentryVitePlugin } from '@sentry/vite-plugin';
|
||||
import tsconfigPaths from 'vite-tsconfig-paths';
|
||||
@ -25,6 +24,7 @@ export default defineConfig((config) => {
|
||||
define: {
|
||||
__COMMIT_HASH: JSON.stringify(getGitHash()),
|
||||
__APP_VERSION: JSON.stringify(process.env.npm_package_version),
|
||||
|
||||
// 'process.env': JSON.stringify(process.env)
|
||||
},
|
||||
build: {
|
||||
@ -62,6 +62,8 @@ export default defineConfig((config) => {
|
||||
'SUPABASE_URL',
|
||||
'SUPABASE_ANON_KEY',
|
||||
'USE_SUPABASE',
|
||||
'DEFAULT_NUM_CTX',
|
||||
'RUNNING_IN_DOCKER',
|
||||
],
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user