2022-07-14 16:36:31 -07:00
|
|
|
const { i18n } = require('./next-i18next.config')
|
2023-03-05 12:33:57 -08:00
|
|
|
const webpack = require('webpack')
|
2023-07-11 14:25:06 -07:00
|
|
|
const { withSentryConfig } = require('@sentry/nextjs')
|
2022-07-14 16:36:31 -07:00
|
|
|
|
2022-04-12 13:48:22 -07:00
|
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
const nextConfig = {
|
2022-07-14 16:36:31 -07:00
|
|
|
i18n,
|
2022-08-11 19:27:21 -07:00
|
|
|
images: {
|
2024-03-03 19:12:31 -08:00
|
|
|
remotePatterns: [
|
|
|
|
{
|
|
|
|
protocol: 'https',
|
|
|
|
hostname: 'raw.githubusercontent.com/**',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
protocol: 'https',
|
|
|
|
hostname: 'arweave.net/**',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
protocol: 'https',
|
|
|
|
hostname: 'images.ctfassets.net/**',
|
|
|
|
},
|
2023-11-12 08:56:39 -08:00
|
|
|
],
|
2022-08-11 19:27:21 -07:00
|
|
|
},
|
2022-07-11 20:00:22 -07:00
|
|
|
reactStrictMode: true,
|
2023-04-05 14:59:30 -07:00
|
|
|
//proxy for openserum api cors
|
|
|
|
rewrites: async () => {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
source: '/openSerumApi/:path*',
|
|
|
|
destination: 'https://openserum.io/api/serum/:path*',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
},
|
2022-07-12 19:02:36 -07:00
|
|
|
webpack: (config, opts) => {
|
|
|
|
if (!opts.isServer) {
|
2022-05-03 21:20:14 -07:00
|
|
|
// 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 12:33:57 -08:00
|
|
|
config.plugins.push(
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env': {
|
|
|
|
BUILD_ID: JSON.stringify(opts.buildId),
|
|
|
|
},
|
2023-07-21 11:47:53 -07:00
|
|
|
}),
|
2023-03-05 12:33:57 -08:00
|
|
|
)
|
|
|
|
|
2022-05-03 21:20:14 -07:00
|
|
|
return config
|
|
|
|
},
|
2022-04-12 13:48:22 -07:00
|
|
|
}
|
|
|
|
|
2023-07-11 14:25:06 -07:00
|
|
|
module.exports = withSentryConfig(
|
|
|
|
nextConfig,
|
|
|
|
{
|
|
|
|
// For all available options, see:
|
|
|
|
// https://github.com/getsentry/sentry-webpack-plugin#options
|
|
|
|
|
|
|
|
// Suppresses source map uploading logs during build
|
|
|
|
silent: true,
|
|
|
|
|
|
|
|
org: 'mango',
|
|
|
|
project: 'mango-v4-ui',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
// For all available options, see:
|
|
|
|
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
|
|
|
|
|
|
|
|
// Upload a larger set of source maps for prettier stack traces (increases build time)
|
|
|
|
widenClientFileUpload: true,
|
|
|
|
|
|
|
|
// Transpiles SDK to be compatible with IE11 (increases bundle size)
|
|
|
|
transpileClientSDK: true,
|
|
|
|
|
|
|
|
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
|
|
|
|
tunnelRoute: '/monitoring',
|
|
|
|
|
|
|
|
// Hides source maps from generated client bundles
|
|
|
|
hideSourceMaps: true,
|
|
|
|
|
|
|
|
// Automatically tree-shake Sentry logger statements to reduce bundle size
|
|
|
|
disableLogger: true,
|
2023-07-21 11:47:53 -07:00
|
|
|
},
|
2023-07-11 14:25:06 -07:00
|
|
|
)
|