Replies: 2 comments
-
Hi @Jarrodsz, if that's really what you want to do, you can already do it with remix flat routes: From your import { flatRoutes } from "remix-flat-routes";
/**
* @type {import('@remix-run/dev').AppConfig}
*/
export default {
ignoredRouteFiles: ["**/*"],
routes: async (defineRoutes) => {
return flatRoutes(
["routes", "../../../packages/package-name/src/routes"],
defineRoutes,
{
ignoredRouteFiles: [
".*",
"**/*.css",
"**/*.test.{js,jsx,ts,tsx}",
"**/__*.*",
],
},
);
},
watchPaths: async () => {
return ["../../packages/package-name/src/**/*"];
},
}; The first argument of |
Beta Was this translation helpful? Give feedback.
-
Hi Phil, just 9 hours ago this issue was closed: I havent looked much at vite and vite plugins but they seem to use yet another solution. What do you think? Thank you. |
Beta Was this translation helpful? Give feedback.
-
Im using remix flat routes package.
And would like to put routes for a package inside the package itself.
Like
/packages/auth/routes/login.tsx
Etc
The application that imports this package then automatically loads the routes in the package folder.
This way the application /routes folder stays lean.
Any thoughts how this could be implemented with remix v2?
In older remix 1.18 last year this was nearly impossible.
This would be a really awesome festure to abstract and seperate logic into packages more🙏
Beta Was this translation helpful? Give feedback.
All reactions