The remix.config.js file defines how the Remix application is built and served. For this project, the server is configured to run in a Cloudflare Workers environment using the worker condition and specific bundling rules to ensure compatibility with the workerd runtime.
module.exports = {
devServerBroadcastDelay: 1000,
ignoredRouteFiles: ['**/.*'],
server: './server.ts',
serverConditions: ['worker'],
serverDependenciesToBundle: [
/^(?!__STATIC_CONTENT_MANIFEST|cloudflare:workers).*$/,
],
serverMainFields: ['workerd', 'browser', 'module', 'main'],
serverMinify: true,
serverModuleFormat: 'esm',
serverPlatform: 'neutral',
tailwind: true,
postcss: true,
}