z4nr34l / next-easy-middlewares

Missing polyfill for multiple next.js middlewares
https://next-easy-middlewares.vercel.app/
MIT License
87 stars 4 forks source link

Matcher auto generation #8

Closed z4nr34l closed 1 month ago

z4nr34l commented 5 months ago

Description: Should generate middleware handler and matcher for exporting in config, where matcher will contain minimal matcher required.

Example:

const {middleware, matcher} = createMiddleware(middlewares, globalMiddlewares);
const config = {
  matcher
};

export { middleware, config }
z4nr34l commented 1 month ago

It's not currently possible as next.js compiler doesn't allow dynamic matchers config.