-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #189 from MakairaIO/MAKAIRA-4748_update-nextjs
MAKAIRA-4748: update nextjs to 15
- Loading branch information
Showing
21 changed files
with
1,435 additions
and
2,011 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { NextRequest, NextResponse } from 'next/server' | ||
|
||
export function middleware(req) { | ||
const pathname = req.nextUrl.pathname | ||
|
||
const pattern = /^(.*)$/ | ||
|
||
if (pattern.test(pathname)) { | ||
const url = req.nextUrl.clone() | ||
|
||
const seoUrl = url.pathname | ||
|
||
url.searchParams.set('seoUrl', seoUrl) | ||
|
||
req.nextUrl.searchParams.forEach((value, key) => { | ||
url.searchParams.set(key, value) | ||
}) | ||
|
||
return NextResponse.rewrite(url) | ||
} | ||
|
||
return NextResponse.next() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,44 @@ | ||
require('dotenv').config() | ||
|
||
const path = require('path') | ||
const Dotenv = require('dotenv-webpack') | ||
|
||
const withBundleAnalyzer = require('@next/bundle-analyzer')({ | ||
enabled: process.env.ANALYZE === 'true', | ||
}) | ||
|
||
module.exports = withBundleAnalyzer({ | ||
trailingSlash: true, | ||
|
||
webpack: (config) => { | ||
config.plugins = config.plugins || [] | ||
|
||
config.plugins = [ | ||
...config.plugins, | ||
|
||
// Read the .env file | ||
new Dotenv({ | ||
path: path.join(__dirname, '.env'), | ||
systemvars: true, | ||
}), | ||
] | ||
|
||
return config | ||
}, | ||
eslint: { | ||
// Warning: This allows production builds to successfully complete even if | ||
// your project has ESLint errors. | ||
ignoreDuringBuilds: true, | ||
}, | ||
async rewrites() { | ||
return [ | ||
{ | ||
source: '/suche', | ||
destination: '/frontend/search', | ||
}, | ||
{ | ||
source: '/search', | ||
destination: '/frontend/search', | ||
}, | ||
{ | ||
source: '/preview', | ||
destination: '/frontend/preview', | ||
}, | ||
{ | ||
source: '/pali/variants/:id', | ||
destination: '/library/entry', | ||
}, | ||
{ | ||
source: '/pali', | ||
destination: '/library/entry', | ||
}, | ||
{ | ||
source: '/:path*', | ||
destination: '/frontend/entry', | ||
}, | ||
] | ||
}, | ||
}) |
Oops, something went wrong.