I'm currently building a project that will work as an addon to another application. I'm currently using NextJS to build the application, but I need to bundle the NextJS JavaScript files into only one. Is that possible?
I'm currently building a project that will work as an addon to another application. I'm currently using NextJS to build the application, but I need to bundle the NextJS JavaScript files into only one. Is that possible?
next export will export all your pages to static HTML files that you can serve with any host (similarly to create-react-app). You can use this as an addon as you can get your pre-existing application to just render the html files at specific endpoints.
However this doesn't bundle everything into a single .js file, but this is the closest you will get. If next export doesn't satisfy your use case maybe its worth asking why you need to bundle everything into a single js file specifically, and if its just JS you need - then why use Next?