Created
August 6, 2021 13:13
-
-
Save endymion1818/af00a048b7b5211c311699b3326ca230 to your computer and use it in GitHub Desktop.
NextJS withPlugins redirects
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
const withPlugins = require('next-compose-plugins'); | |
const withSourceMaps = require('@zeit/next-source-maps'); | |
const nextConfig = { | |
basePath: '/messages', | |
}; | |
const _withSourceMaps = [ | |
withSourceMaps, | |
{ | |
webpack: (config, options) => config, | |
}, | |
]; | |
const redirects = { | |
async redirects() { | |
return [ | |
{ | |
source: '/', | |
destination: `/some/destination`, | |
permanent: false | |
}, | |
{ | |
source: '/:path*', | |
destination: `/some/destination/:path*`, | |
permanent: false | |
} | |
] | |
} | |
} | |
module.exports = withPlugins([_withSourceMaps, nextConfig, [redirects]]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment