File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,14 @@ import nodePreset from './node'
4
4
5
5
export default definePreset ( {
6
6
name : 'vercel' ,
7
+ async setup ( options ) {
8
+ options . database ||= { type : 'sqlite' , filename : '/tmp/contents.sqlite' }
9
+ } ,
7
10
async setupNitro ( nitroConfig , options ) {
8
- if ( nitroConfig . runtimeConfig ?. content ?. database ?. type === 'sqlite' ) {
9
- logger . warn ( 'Deploying sqlite database to Vercel is not recommended if you are not prerendering your site.' )
10
- logger . info ( 'We recommend using a hosted SQL database like Neon, Turso, Supabase or others.' )
11
+ const database = nitroConfig . runtimeConfig ?. content ?. database
12
+ if ( database ?. type === 'sqlite' && ! database ?. filename ?. startsWith ( '/tmp' ) ) {
13
+ logger . warn ( 'Deploying sqlite database to Vercel is possible only in `/tmp` directory. Using `/tmp/contents.sqlite` instead.' )
14
+ database . filename = '/tmp/contents.sqlite'
11
15
}
12
16
13
17
await nodePreset . setupNitro ( nitroConfig , options )
You can’t perform that action at this time.
0 commit comments