- Documentation
- /
- Remix Supabase
- /
- Deploying to Vercel
Deploying to Vercel
Learn how to deploy your Remix app to Vercel
If you want to deploy your Remix app to Vercel, you can do so by following these steps.
1) Install the Remix Vercel package
npm i -D @remix-run/vercel
2) Add a server.js
file in the root of your project
Then, add the following file to the root of your project:
import { createRequestHandler } from '@remix-run/vercel';
import * as build from '@remix-run/dev/server-build';
export default createRequestHandler({ build, mode: process.env.NODE_ENV });
3) Update the Remix configuration
Finally, update your remix.config.js
file to include the following:
/**
* @type {import('@remix-run/dev').AppConfig}
*/
module.exports = {
serverBuildTarget: 'vercel',
server: ['test', 'development'].includes(process.env.NODE_ENV)
? undefined
: './server.js',
cacheDirectory: './node_modules/.cache/remix',
ignoredRouteFiles: ['**/.*', '**/*.css', '**/*.test.{js,jsx,ts,tsx}'],
future: {},
};
🎉 Et voilà ! You should now be able to deploy your Remix app to Vercel.