@@ -4,14 +4,18 @@ import { getConvexEnvs } from 'backend-convex/_util'
44import { config } from 'dotenv'
55import optimizeExclude from 'vite-plugin-optimize-exclude'
66
7- if ( import . meta. env . NODE_ENV === 'development' )
7+ if ( import . meta. env . NODE_ENV === 'development' ) {
88 config ( { path : [ '.env.local.ignored' , '.env.local' ] } )
9- else
9+ import . meta. env . NUXT_PUBLIC_CONVEX_URL ||= ( await getConvexEnvs ( ) ) . CONVEX_URL || ''
10+ }
11+ else {
1012 config ( { path : [ '.env.prod.ignored' , '.env.prod' ] } )
13+ }
1114
1215const siteConfig = {
1316 url : import . meta. env . NUXT_PUBLIC_FRONTEND_URL ,
1417 backend : import . meta. env . NUXT_PUBLIC_BACKEND_URL ,
18+ convex : import . meta. env . NUXT_PUBLIC_CONVEX_URL ,
1519 name : 'starter-monorepo' ,
1620 description : 'Monorepo with 🤖 AI initialize and localize | 🔥Hono + OpenAPI & RPC, Nuxt, Convex, SST Ion, Kinde Auth, Tanstack Query, Shadcn, UnoCSS, Spreadsheet I18n, Lingo.dev' ,
1721}
@@ -25,8 +29,6 @@ function genFrontendLocale(code: string, languageISO: string, dir?: LocaleObject
2529 }
2630}
2731
28- const convexLocalEnvs = await getConvexEnvs ( )
29-
3032// https://nuxt.com/docs/api/configuration/nuxt-config
3133export default defineNuxtConfig ( {
3234 future : {
@@ -36,6 +38,7 @@ export default defineNuxtConfig({
3638 devtools : { enabled : true } ,
3739
3840 experimental : {
41+ viewTransition : true ,
3942 watcher : 'parcel' ,
4043 componentIslands : true ,
4144 } ,
@@ -57,10 +60,13 @@ export default defineNuxtConfig({
5760 public : {
5861 frontendUrl : siteConfig . url ,
5962 backendUrl : siteConfig . backend ,
63+ convexUrl : siteConfig . convex ,
64+ convexApiUrl : siteConfig . convex . replace ( '.convex.cloud' , '.convex.site' ) ,
6065 } ,
6166 } ,
6267
6368 app : {
69+ viewTransition : false ,
6470 head : {
6571 link : [
6672 { rel : 'icon' , href : '/favicon.svg' , type : 'image/svg+xml' } ,
@@ -89,6 +95,9 @@ export default defineNuxtConfig({
8995 'clsx' ,
9096 'embla-carousel-vue' ,
9197 ] ,
98+ include : [
99+ 'secure-json-parse' ,
100+ ] ,
92101 } ,
93102 } ,
94103
@@ -110,7 +119,7 @@ export default defineNuxtConfig({
110119 ] ,
111120
112121 convex : {
113- url : import . meta . env . NUXT_PUBLIC_CONVEX_URL || convexLocalEnvs . CONVEX_URL || '' ,
122+ url : siteConfig . convex ,
114123 manualInit : true ,
115124 } ,
116125
0 commit comments