Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the name of the generated file #49

Closed
gino opened this issue Feb 15, 2023 · 2 comments
Closed

Changing the name of the generated file #49

gino opened this issue Feb 15, 2023 · 2 comments

Comments

@gino
Copy link

gino commented Feb 15, 2023

Hi there,

I am wondering if it's possible to change the name of the routes file that gets generated. I would prefer something like _routes.tsx instead of routes.gen.tsx, if possible.

Thanks a lot.

@oedotme
Copy link
Owner

oedotme commented Feb 16, 2023

Hey @gino, It was planned to support two config options for the plugins. The first is the same as what you mentioned to provide a custom generated file name and the other for disabling formatting with prettier.

Right now the plugins use the defaults, but should be straight forward to support user options.

I'll update this issue once added. Thanks!

@oedotme
Copy link
Owner

oedotme commented Feb 19, 2023

It's now possible to provide options to generouted's Vite plugins, here's the usage with the default values:

// vite.config.ts

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import generouted from '@generouted/react-router'

export default defineConfig({
  plugins: [react(), generouted({ output: 'routes.gen.tsx', format: true )],
})

Added at https://github.com/oedotme/generouted/releases/tag/v1.7.14

@oedotme oedotme closed this as completed Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants