Should NextJS Static Site Generation provide all the files normally in "/public" or "/static"?
Unanswered
Weimaraner posted this in #help-forum
WeimaranerOP
My team has built a middlewear that uses NextJS to generate all the pages of our Strapi site and that is working. But the rest of files needed to host the site (images, CSS, JS, etc..) are not in the output folder. I'm not clear if it should work that way and we need to run a separate process to collect those files, but I had assumed (danger!) that an SSG process would output all the files.
Thanks!
Thanks!
3 Replies
@Weimaraner My team has built a middlewear that uses NextJS to generate all the pages of our Strapi site and that is working. But the rest of files needed to host the site (images, CSS, JS, etc..) are not in the output folder. I'm not clear if it should work that way and we need to run a separate process to collect those files, but I had assumed (danger!) that an SSG process would output all the files.
Thanks!
Asian black bear
It really depends, are you using
or this:
import to load the files into your pages, or just referring to them relatively from a directory of static files? Like are you doing this:import 'style.css'or this:
<link href="/static/style.css"/>Using the first way with
import it will definitely bundle the file with a unique immutable hash-based file name.the second way it will not bundle