Replies: 1 comment
-
The server JS file is always output for pages with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So... weird behaviour I've encountered with NextJS's new static-first focus. For a project with the following structure:
I get this
.next/serverless/pages
structure.Now, the way
blog/[slug].js
vs the prerendered posts make sense, since that's usinggetStaticPaths
which I assume can be dynamic, but I'm a bit suprised to seeblog.js
there.For reference, this is the
getStaticProps
logic I have inblog/index.js
...From my understanding,
getStaticProps
run only at build time, so this should mean that only.next/serverless/pages/blog.html
is generated, not.next/serverless/pages/blog.js
, yet both are there. Does anyone know why both are outputted?Does every file that uses
getStaticProps
generate a.js
file on the serverless build? And is that designed to allow the hosting platform to refresh the static snapshot? I thought you had to opt-in to that behaviour...Beta Was this translation helpful? Give feedback.
All reactions