Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump netlify/next runtime and fix api routes in middleware #13040

Merged
merged 5 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,4 @@
[[plugins.inputs.audits]]
path = "en/developers/docs/intro-to-ethereum/"
[[plugins.inputs.audits]]
path = "en/developers/tutorials/creating-a-wagmi-ui-for-your-contract/"

[functions]

[functions.___netlify-odb-handler]
external_node_modules = ["sharp"]
included_files = [
"./src/intl/**/*",
"!./public/**/*",
"node_modules/next/dist/server/future/route-modules/pages/vendored/contexts/router-context*",
"node_modules/next/dist/server/future/route-modules/pages/vendored/contexts/amp-context*",
"node_modules/next/dist/server/future/route-modules/pages/vendored/contexts/head-manager-context*",
"node_modules/sharp/**/*",
]

[functions.___netlify-handler]
included_files = [
"./src/intl/**/*",
"!./public/**/*",
"node_modules/next/dist/server/future/route-modules/pages/vendored/contexts/router-context*",
"node_modules/next/dist/server/future/route-modules/pages/vendored/contexts/amp-context*",
"node_modules/next/dist/server/future/route-modules/pages/vendored/contexts/head-manager-context*",
]
path = "en/developers/tutorials/creating-a-wagmi-ui-for-your-contract/"
3 changes: 1 addition & 2 deletions next-i18next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ module.exports = {
// url. Ref: https://nextjs.org/docs/pages/building-your-application/routing/internationalization#prefixing-the-default-locale
defaultLocale: "default",
// supported locales defined in `i18n.config.json`
locales: ["default", ...locales],
localeDetection: false,
locales: [...locales, "default"],
},
// define custom location for intl files, otherwise default to public/locales (https://github.com/i18next/next-i18next#2-translation-content)
localePath: "./src/intl",
Expand Down
47 changes: 46 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,55 @@ module.exports = (phase, { defaultConfig }) => {
images: {
deviceSizes: [640, 750, 828, 1080, 1200, 1504, 1920],
},
async redirects() {
/**
* Redirect /default to /en.
*
* This allows us to always have a default locale prefix for all URLs.
*
* @see https://github.com/vercel/next.js/discussions/18419#discussioncomment-327128
*/
return [
{
source: "/default",
destination: "/en",
locale: false,
permanent: false,
},
{
source: "/default/:slug*",
destination: "/en/:slug*",
locale: false,
permanent: false,
},
]
},
}

if (phase !== PHASE_DEVELOPMENT_SERVER) {
nextConfig = { ...nextConfig, experimental }
nextConfig = {
...nextConfig,
experimental: {
...experimental,
outputFileTracingExcludes: {
"*": [
/**
* Exclude these paths from the trace output to avoid bloating the
* Netlify functions bundle.
*
* @see https://github.com/orgs/vercel/discussions/103#discussioncomment-5427097
* @see https://nextjs.org/docs/app/api-reference/next-config-js/output#automatically-copying-traced-files
*/
"node_modules/@swc/core-linux-x64-gnu",
"node_modules/@swc/core-linux-x64-musl",
"node_modules/@esbuild/linux-x64",
"public/**/*.png",
"public/**/*.gif",
"src/data",
],
},
},
}
}

return nextConfig
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
"devDependencies": {
"@chakra-ui/cli": "^2.4.1",
"@netlify/plugin-nextjs": "^4.41.3",
"@netlify/plugin-nextjs": "^5.0.0",
"@storybook/addon-essentials": "7.6.6",
"@storybook/addon-interactions": "7.6.6",
"@storybook/addon-links": "7.6.6",
Expand Down
62 changes: 0 additions & 62 deletions src/middleware.ts

This file was deleted.

Loading
Loading