mango-web/next.config.js

135 lines
3.2 KiB
JavaScript
Raw Permalink Normal View History

2023-03-05 18:44:20 -08:00
const webpack = require('webpack')
2023-02-22 05:13:31 -08:00
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
2024-01-08 03:39:45 -08:00
remotePatterns: [
{
protocol: 'https',
hostname: 'raw.githubusercontent.com/**',
},
{
protocol: 'https',
hostname: 'arweave.net/**',
},
{
protocol: 'https',
hostname: 'img.fotofolio.xyz/**',
},
2024-02-01 17:00:50 -08:00
{
protocol: 'https',
hostname: 'images.ctfassets.net/**',
},
2024-01-08 03:39:45 -08:00
],
2023-02-22 05:13:31 -08:00
},
reactStrictMode: true,
2024-01-01 04:30:07 -08:00
async redirects() {
return [
2024-03-06 19:35:23 -08:00
{
source: '/:path*',
has: [{ type: 'host', value: 'www.mango.markets' }],
destination: 'https://mango.markets/:path*',
permanent: true,
},
2024-01-01 04:30:07 -08:00
{
source: '/explore',
destination: '/explore/tokens',
// 308 redirect
permanent: true,
},
2024-01-09 03:07:08 -08:00
{
source: '/explore/categories/governanace',
destination: '/explore/categories/governance',
// 308 redirect
permanent: true,
},
2024-01-24 19:55:12 -08:00
{
source: '/explore/categories/perps',
destination: '/explore/categories/derivatives',
// 308 redirect
permanent: true,
},
{
source: '/explore/categories/oracle',
destination: '/explore/categories',
// 308 redirect
permanent: true,
},
{
source: '/explore/categories/tokenized-asset',
destination: '/explore/categories',
// 308 redirect
permanent: true,
},
{
source: '/explore/categories/yield-bearing',
destination: '/explore/categories',
// 308 redirect
permanent: true,
},
{
source: '/explore/categories/options',
destination: '/explore/categories',
// 308 redirect
permanent: true,
},
{
source: '/explore/categories/layer-2',
destination: '/explore/categories',
// 308 redirect
permanent: true,
},
{
source: '/explore/categories/dog-coin',
destination: '/explore/categories',
// 308 redirect
permanent: true,
},
{
source: '/explore/categories/amm',
destination: '/explore/categories',
// 308 redirect
permanent: true,
},
{
source: '/explore/categories/gambling',
destination: '/explore/categories',
// 308 redirect
permanent: true,
},
2024-01-30 04:20:26 -08:00
{
source: '/explore/categories/domains',
destination: '/explore/categories',
// 308 redirect
permanent: true,
},
{
source: '/explore/categories/social',
destination: '/explore/categories',
// 308 redirect
permanent: true,
},
2024-01-01 04:30:07 -08:00
]
},
2023-02-22 05:13:31 -08:00
webpack: (config, opts) => {
if (!opts.isServer) {
// don't resolve 'fs' module on the client to prevent this error on build --> Error: Can't resolve 'fs'
config.resolve.fallback = {
fs: false,
}
}
2023-03-05 18:44:20 -08:00
config.plugins.push(
new webpack.DefinePlugin({
'process.env': {
BUILD_ID: JSON.stringify(opts.buildId),
},
}),
2023-03-05 18:44:20 -08:00
)
return config
},
}
2023-02-22 05:13:31 -08:00
module.exports = nextConfig