I’ve built a Next.js app, and I wanted to use static exporting to host the project on my hosting. The app is simple, so I didn’t use most of the features that Next.js offers. When I run:
npm run build (next build && next export)
i get .next folder and out folder which has the following folders:
/static /chunks /css /media
I have all the needed settings (ie: output: "export", in next.config.js..)
I'm supposed to get all the static HTML files..but i haven’t get those, any solutions please?
Update:
This happened because image optimization is active and works under the hood,for that the app has to run on a server but i'm trying to generate a static website, i disabled it by adding the following to next.config.js:
module.exports = {
images: {
unoptimized: true,
},
}
And it worked as expected.
/in all urls andfile://protocol doesn't handle that properly.