tatethurston / nextjs-routes

Type safe routing for Next.js
MIT License
566 stars 23 forks source link

Support next.config.cjs, next.config.mjs #165

Closed Inshiku-Han closed 1 year ago

Inshiku-Han commented 1 year ago

Hi

Thank you for your development. This library is very useful

But It dosen't work to next.config.cjs and next.config.mjs

Any Plan to update?

tatethurston commented 1 year ago

@insik-han This library should work with both next.config.cjs and next.config.mjs already. If you look at the examples, you’ll see next.config.mjs used.

What is the issue you’re running into?

Inshiku-Han commented 1 year ago

When I try to next.config.cjs, It dosen't create nextjs-routers.d.ts. Here's my code image But next.config.mjs is works. Sorry. There is problem in next.config.cjs

tatethurston commented 1 year ago

@insik-han There is also an example using commonjs (the typescript example). Can you share the error you're encountering?

Note that nextjs itself does not support .cjs extensions. You cannot use next.config.cjs with nextjs. That is not a limitation of this library.