File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 3
3
exports [` onBuild() writes correct redirects to netlifyConfig 1` ] = `
4
4
"/_next/image* /_ipx/w_:width,q_:quality/:url 301
5
5
/_ipx/* /.netlify/functions/_ipx 200
6
- /_next/data/I9WsDBcMY6HmfxTpCRMvs /getStaticProps/withFallback/:id.json /.netlify/functions/___netlify-odb-handler 200
7
- /_next/data/I9WsDBcMY6HmfxTpCRMvs /getStaticProps/withFallback/:slug/* /.netlify/functions/___netlify-odb-handler 200
8
- /_next/data/I9WsDBcMY6HmfxTpCRMvs /getStaticProps/withFallbackBlocking/:id.json /.netlify/functions/___netlify-odb-handler 200
9
- /_next/data/I9WsDBcMY6HmfxTpCRMvs /getStaticProps/withRevalidate/withFallback/:id.json /.netlify/functions/___netlify-odb-handler 200
6
+ /_next/data/%BUILD_ID% /getStaticProps/withFallback/:id.json /.netlify/functions/___netlify-odb-handler 200
7
+ /_next/data/%BUILD_ID% /getStaticProps/withFallback/:slug/* /.netlify/functions/___netlify-odb-handler 200
8
+ /_next/data/%BUILD_ID% /getStaticProps/withFallbackBlocking/:id.json /.netlify/functions/___netlify-odb-handler 200
9
+ /_next/data/%BUILD_ID% /getStaticProps/withRevalidate/withFallback/:id.json /.netlify/functions/___netlify-odb-handler 200
10
10
/getStaticProps/withFallback/:id /.netlify/functions/___netlify-odb-handler 200
11
11
/getStaticProps/withFallback/:slug/* /.netlify/functions/___netlify-odb-handler 200
12
12
/getStaticProps/withFallbackBlocking/:id /.netlify/functions/___netlify-odb-handler 200
Original file line number Diff line number Diff line change @@ -302,10 +302,14 @@ describe('onBuild()', () => {
302
302
utils,
303
303
} )
304
304
305
- const redirects = netlifyConfig . redirects . reduce ( ( acc , curr ) => {
305
+ let redirects = netlifyConfig . redirects . reduce ( ( acc , curr ) => {
306
306
const { from, to, status } = curr
307
307
return acc + `${ from } ${ to } ${ status } \n`
308
308
} , '' )
309
+
310
+ // Replace non-persistent build ID with placeholder
311
+ redirects = redirects . replace ( / \/ _ n e x t \/ d a t a \/ [ ^ \/ ] + \/ / g, '/_next/data/%BUILD_ID%/' )
312
+
309
313
expect ( redirects ) . toMatchSnapshot ( )
310
314
} )
311
315
You can’t perform that action at this time.
0 commit comments