Skip to content

Commit

Permalink
avoid ISR on output=export mode (#930)
Browse files Browse the repository at this point in the history
  • Loading branch information
cometkim authored Nov 6, 2024
1 parent 55020b1 commit 04d1522
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/Packages.res
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,9 @@ let getStaticProps: Next.GetStaticProps.revalidate<props, unit> = async _ctx =>

{
"props": props,
"revalidate": 43200,
"revalidate": switch Node.Process.env->Dict.get("BUILD_STATIC") {
| Some("true") => Nullable.undefined
| _ => Nullable.make(43200)
},
}
}
2 changes: 1 addition & 1 deletion src/bindings/Next.res
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module GetStaticProps = {

type revalidate<'props, 'params> = context<'props, 'params> => promise<{
"props": 'props,
"revalidate": int,
"revalidate": Nullable.t<int>,
}>
}

Expand Down
2 changes: 1 addition & 1 deletion src/bindings/Next.resi
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module GetStaticProps: {

type revalidate<'props, 'params> = context<'props, 'params> => promise<{
"props": 'props,
"revalidate": int,
"revalidate": Nullable.t<int>,
}>
}

Expand Down

0 comments on commit 04d1522

Please sign in to comment.