Open Guria opened 1 year ago
Hey @Guria this is a cool idea, I’d be happy to look into supporting this use case. Could you tell me a little more about the code generation you would like to do?
I'd like to have something like on the https://ariakit.org/
It is also made with Next JS https://github.com/ariakit/ariakit/blob/main/website/build-pages/pages-webpack-plugin.js
In my case I don't need a full text search, but I will definetely will need some meta information like titles, descriptions, etc. It may be defined in route pages files or collocated in yml files. So potentially we will need to also be able to inject logic in traversing and not only just receiving final result.
You have implemented a good module which can be used for more potential use cases. I personally would like to have it for making custom navigation that will be auto generated from available routes. I see that you can have an can pass a callback option to NextJSRoutesPlugin. This callback will accept parsed data from routes and will do code generation.