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

Allow nextjs-routes cli configuration via nextjs-routes.config.js file #136

Open
tatethurston opened this issue Apr 9, 2023 · 5 comments · Fixed by #204
Open

Allow nextjs-routes cli configuration via nextjs-routes.config.js file #136

tatethurston opened this issue Apr 9, 2023 · 5 comments · Fixed by #204
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tatethurston
Copy link
Owner

nextjs-routes can be invoked via cli: npx nextjs-routes. Presently, no configuration options are passed to the cli execution.

  1. Read a nextjs-routes.config.js if present.
  2. Log the location of the found config file
  3. Validate the config file has the expected shape (no unknown keys).
  4. Pass the config file values to the invocation of writeNextjsRoutes in src/cli.
@tatethurston tatethurston added enhancement New feature or request good first issue Good for newcomers labels Apr 9, 2023
@tatethurston
Copy link
Owner Author

tatethurston commented Apr 19, 2023

Alternatively, read next.config.js to derive the configuration. This seems preferable, but is more difficult because of the configuration under the webpack key. We could add a custom webpack key or use globals to pass configuration.

@airtonix
Copy link
Contributor

i wouldn't.

just make them cli args.

@tatethurston
Copy link
Owner Author

Yeah, also happy with a cli args approach.

@trevoro
Copy link

trevoro commented Jul 24, 2023

@tatethurston Did the CLI get removed in the latest npm published package? I cannot find any concept of a CLI or executable in there but this issue references one existing.

EDIT NVM I am blind.

@tatethurston
Copy link
Owner Author

Published 2.2.4-rc.1 which reads in next.config.js. Support for cwd and outDir to follow in a subsequent rc.

@tatethurston tatethurston reopened this Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants