fix prod env

This commit is contained in:
Jeff Emmett 2024-12-07 13:43:56 -05:00
parent 614c1f2dcf
commit d6a5019b72
2 changed files with 30 additions and 43 deletions

View File

@ -27,10 +27,7 @@ import { useCameraControls } from '@/hooks/useCameraControls'
import { zoomToSelection } from '../ui-overrides'
// Default to production URL if env var isn't available
const DEFAULT_WORKER_URL = 'https://jeffemmett-canvas.jeffemmett.workers.dev';
export const WORKER_URL = typeof import.meta.env.VITE_TLDRAW_WORKER_URL === 'string'
? import.meta.env.VITE_TLDRAW_WORKER_URL
: DEFAULT_WORKER_URL;
export const WORKER_URL = 'https://jeffemmett-canvas.jeffemmett.workers.dev';
const shapeUtils = [ChatBoxShape, VideoChatShape, EmbedShape]
const tools = [ChatBoxTool, VideoChatTool, EmbedTool]; // Array of tools

View File

@ -5,11 +5,7 @@ import wasm from "vite-plugin-wasm";
import topLevelAwait from "vite-plugin-top-level-await";
import { viteStaticCopy } from 'vite-plugin-static-copy';
export default defineConfig(({ mode }) => {
// Load env file based on `mode` in the current working directory.
const env = loadEnv(mode, process.cwd(), '');
return {
export default defineConfig({
envPrefix: ['VITE_'],
plugins: [
react(),
@ -38,11 +34,5 @@ export default defineConfig(({ mode }) => {
alias: {
'@': '/src',
},
},
define: {
'import.meta.env.VITE_TLDRAW_WORKER_URL': JSON.stringify(
env.VITE_TLDRAW_WORKER_URL || 'https://jeffemmett-canvas.jeffemmett.workers.dev'
)
}
};
});