Skip to content

Commit 6635373

Browse files
committed
Merge branch 'main' into v4
2 parents a5b0b21 + deeb0ad commit 6635373

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

package-lock.json

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"dependencies": {
5353
"@babel/core": "^7.15.0",
5454
"@netlify/functions": "^0.7.2",
55-
"@netlify/ipx": "^0.0.5",
55+
"@netlify/ipx": "^0.0.7",
5656
"@vercel/node": "^1.11.2-canary.4",
5757
"chalk": "^4.1.2",
5858
"fs-extra": "^10.0.0",

src/helpers/config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ exports.generateRedirects = async ({ netlifyConfig, basePath, i18n }) => {
7676
redirects.push(...getNetlifyRoutes(route), ...getNetlifyRoutes(dataRoute))
7777
})
7878

79-
// Needed only for /_next/static
80-
const i18nSplat = i18n ? '/:locale' : ''
81-
79+
if (i18n) {
80+
netlifyConfig.redirects.push({ from: `${basePath}/:locale/_next/static/*`, to: `/static/:splat`, status: 200 })
81+
}
8282
// This is only used in prod, so dev uses `next dev` directly
8383
netlifyConfig.redirects.push(
84-
{ from: `${basePath}${i18nSplat}/_next/static/*`, to: `${i18nSplat}/static/:splat`, status: 200 },
84+
{ from: `${basePath}/_next/static/*`, to: `/static/:splat`, status: 200 },
8585
{
8686
from: `${basePath}/*`,
8787
to: HANDLER_FUNCTION_PATH,

test/__snapshots__/index.js.snap

+6-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@ Array [
7474
Object {
7575
"from": "/:locale/_next/static/*",
7676
"status": 200,
77-
"to": "/:locale/static/:splat",
77+
"to": "/static/:splat",
78+
},
79+
Object {
80+
"from": "/_next/static/*",
81+
"status": 200,
82+
"to": "/static/:splat",
7883
},
7984
Object {
8085
"conditions": Object {

0 commit comments

Comments
 (0)