Skip to content

Commit

Permalink
Deploy to vercel
Browse files Browse the repository at this point in the history
  • Loading branch information
Yureien committed Oct 8, 2023
1 parent 994652a commit 5f73b4b
Show file tree
Hide file tree
Showing 4 changed files with 473 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ node_modules
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.vercel
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-node": "^1.2.4",
"@sveltejs/adapter-vercel": "^3.0.3",
"@sveltejs/kit": "^1.5.0",
"@types/node-cron": "^3.0.7",
"@types/nodemailer": "^6.4.11",
Expand Down
12 changes: 11 additions & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import adapter from '@sveltejs/adapter-node';
import adapterVercel from '@sveltejs/adapter-vercel';
import { vitePreprocess } from '@sveltejs/kit/vite';

/** @type {import('@sveltejs/adapter-vercel').Config} */
export const adapterVercelConfig = {
runtime: 'nodejs18.x',
regions: ['sin1'],
memory: 512
};

const isVercel = process.env.VERCEL !== undefined; // Deploy to Vercel

/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
Expand All @@ -11,7 +21,7 @@ const config = {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter(),
adapter: isVercel ? adapterVercel(adapterVercelConfig) : adapter(),
alias: {
'@db': './src/lib/server/prisma/prisma.ts'
}
Expand Down
Loading

0 comments on commit 5f73b4b

Please sign in to comment.