@remix-run/v1-route-convention
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

V1 Route Convention

Enables the v1 route file convention in Remix v2.

// remix.config.js
const { createRoutesFromFolders } = require("@remix-run/v1-route-convention");

/** @type {import('@remix-run/dev').AppConfig} */
module.exports = {
  // Tell Remix to ignore everything in the routes directory.
  // We'll let `createRoutesFromFolders` take care of that.
  ignoredRouteFiles: ["**/*"],
  routes: (defineRoutes) => {
    // `createRoutesFromFolders` will create routes for all files in the
    // routes directory using the same default conventions as Remix v1.
    return createRoutesFromFolders(defineRoutes, {
      // If you're already using `ignoredRouteFiles` in your Remix config,
      // you can move them to `ignoredFilePatterns` in the plugin's options.
      ignoredFilePatterns: ["**/.*", "**/*.css"],
    });
  },
};

Readme

Keywords

none

Package Sidebar

Install

npm i @remix-run/v1-route-convention

Homepage

remix.run

Weekly Downloads

58,271

Version

0.1.4

License

MIT

Unpacked Size

40.8 kB

Total Files

9

Last publish

Collaborators

  • chancestrickland
  • mjackson