'How to package Next.js application as a reusable Node library?

I have built a next.js application with some bare minimum functionality that includes:

  • Middleware for authentication
  • Protected file serving api routes
  • Logging for error handling

Now I want to publish this as an npm module and allow other teams to build their own pages/views on top of this. How to bundle and publish this next.js application as a library?



Solution 1:[1]

You can use github with npm registry to publish your package. Github packages npm registry

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nihal-Meshram