File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 < head >
44 < meta charset ="UTF-8 " />
55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6- < link rel ="icon " href =" /new-assets/visualailogo.webp " />
6+ < link rel ="icon " />
77 < script src ="https://cdn.tailwindcss.com "> </ script >
88 < title > Langflow Landing Page</ title >
99 </ head >
Original file line number Diff line number Diff line change 11// Shared constants for routing within the new landing page experience.
22// Keep this in sync with the BrowserRouter basename so redirects land on the
33// correct path regardless of which component triggers them.
4- export const LANDING_BASENAME = "/new/landingpage" ;
4+ const BASE_URL = import . meta. env . BASE_URL ?? "/" ;
5+
6+ export const LANDING_BASENAME =
7+ BASE_URL . length > 1 && BASE_URL . endsWith ( "/" )
8+ ? BASE_URL . slice ( 0 , - 1 )
9+ : BASE_URL ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React from "react";
22import ReactDOM from "react-dom/client" ;
33import { ClerkProvider } from "@clerk/clerk-react" ;
44import { CookiesProvider } from "react-cookie" ;
5+ import faviconUrl from "./new-assets/visualailogo.webp?inline" ;
56import App from "./App" ;
67import "./index.css" ;
78
@@ -11,6 +12,37 @@ if (!clerkPublishableKey) {
1112 console . warn ( "VITE_CLERK_PUBLISHABLE_KEY is not set. Clerk login will not function correctly." ) ;
1213}
1314
15+ import React from "react" ;
16+ import ReactDOM from "react-dom/client" ;
17+ import { ClerkProvider } from "@clerk/clerk-react" ;
18+ import { CookiesProvider } from "react-cookie" ;
19+ import App from "./App" ;
20+ import faviconUrl from "./new-assets/visualailogo.webp?inline" ;
21+ import "./index.css" ;
22+
23+ const clerkPublishableKey = import . meta. env . VITE_CLERK_PUBLISHABLE_KEY || "" ;
24+
25+ if ( ! clerkPublishableKey ) {
26+ console . warn ( "VITE_CLERK_PUBLISHABLE_KEY is not set. Clerk login will not function correctly." ) ;
27+ }
28+
29+ const setFavicon = ( href : string ) => {
30+ if ( typeof document === "undefined" ) {
31+ return ;
32+ }
33+
34+ let favicon = document . querySelector < HTMLLinkElement > ( 'link[rel~="icon"]' ) ;
35+ if ( ! favicon ) {
36+ favicon = document . createElement ( "link" ) ;
37+ favicon . rel = "icon" ;
38+ document . head . appendChild ( favicon ) ;
39+ }
40+
41+ favicon . href = href ;
42+ } ;
43+
44+ setFavicon ( faviconUrl ) ;
45+
1446ReactDOM . createRoot ( document . getElementById ( "root" ) as HTMLElement ) . render (
1547 < React . StrictMode >
1648 < CookiesProvider >
Original file line number Diff line number Diff line change 1- import { defineConfig } from "vite" ;
1+ import { defineConfig , loadEnv } from "vite" ;
22import react from "@vitejs/plugin-react-swc" ;
33
4- export default defineConfig ( {
5- plugins : [ react ( ) ] ,
6- base : "/new/landingpage/" ,
7- build : {
8- outDir : "dist" ,
9- emptyOutDir : true
10- }
4+ export default defineConfig ( ( { mode } ) => {
5+ const env = loadEnv ( mode , process . cwd ( ) , "VITE_" ) ;
6+ const base = env . VITE_LANDING_BASE ?? "/new/landingpage/" ;
7+
8+ return {
9+ plugins : [ react ( ) ] ,
10+ base,
11+ build : {
12+ outDir : "dist" ,
13+ emptyOutDir : true ,
14+ } ,
15+ } ;
1116} ) ;
You can’t perform that action at this time.
0 commit comments