-
Just a simple question before i try to get this working in production with remix run 1.9.x. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Yes, The simplest way to configure it is to just copy the configuration from the README. Just make sure to set the const { flatRoutes } = require('remix-flat-routes')
/**
* @type {import("@remix-run/dev").AppConfig}
*/
module.exports = {
// ignore all files in routes folder to prevent
// default remix convention from picking up routes
ignoredRouteFiles: ['**/*'],
routes: async defineRoutes => {
return flatRoutes('routes', defineRoutes)
},
} If you're using ESM, then just convert the syntax to: import { flatRoutes } from 'remix-flat-routes'
/**
* @type {import("@remix-run/dev").AppConfig}
*/
export default {
// ignore all files in routes folder to prevent
// default remix convention from picking up routes
ignoredRouteFiles: ['**/*'],
routes: async defineRoutes => {
return flatRoutes('routes', defineRoutes)
},
} |
Beta Was this translation helpful? Give feedback.
Yes,
remix-flat-routes
works with all versions of Remix from v1.5+.The simplest way to configure it is to just copy the configuration from the README.
Just make sure to set the
ignoredRouteFiles
to ignore ALL files, so Remix doesn't try to process them beforeremix-flat-routes
.If you're using ESM, then just convert the syntax to: