This repository was archived by the owner on Feb 26, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.mjs
More file actions
108 lines (100 loc) · 2.62 KB
/
next.config.mjs
File metadata and controls
108 lines (100 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import NextBundleAnalyzer from '@next/bundle-analyzer';
import { withSentryConfig } from '@sentry/nextjs';
import { env } from './src/env.mjs';
const withBundleAnalyzer = NextBundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
});
const SentryWebpackPluginOptions = { silent: true, dryRun: !env.NEXT_PUBLIC_SENTRY_DSN };
const basePath = env.NEXT_PUBLIC_BASE_PATH;
/**
* @returns `1.0.0` in devlopment mode, and `1.0.0 (776dc84)` after CI compiles it.
*/
function getVersion() {
const version = env.npm_package_version;
const commit = env.CI_COMMIT_SHORT_SHA;
return commit ? `${version} (${commit})` : version;
}
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config) => {
config.resolve.alias.canvas = false;
config.resolve.alias.encoding = false;
/**
* Using WebGL shaders as modules.
*/
config.module.rules.push({
test: /\.(vert|frag)$/i,
// More information here https://webpack.js.org/guides/asset-modules/
type: 'asset/source',
});
return config;
},
env: {
applicationVersion: getVersion(),
},
basePath,
assetPrefix: basePath ?? undefined,
reactStrictMode: true,
swcMinify: true,
compress: false,
output: 'standalone',
sentry: {
hideSourceMaps: false,
},
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
async redirects() {
return [
{ source: '/virtual-lab/:path*', destination: '/dev/virtual-lab/:path*', permanent: false },
{
source: '/build',
destination: '/build/cell-composition/interactive',
permanent: false,
},
{
source: '/build/connectome-definition',
destination: '/build/connectome-definition/configuration',
permanent: false,
},
{
source: '/build/cell-model-assignment',
destination: '/build/cell-model-assignment/m-model/configuration',
permanent: false,
},
{
source: '/experiment-designer',
destination: '/experiment-designer/experiment-setup',
permanent: false,
},
];
},
async rewrites() {
return [
{
source: '/dev/virtual-lab/:path*',
destination: '/virtual-lab/:path*',
},
];
},
transpilePackages: ['jotai-devtools'],
logging: {
fetches: {
fullUrl: true,
},
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'sbo-nexus-delta.shapes-registry.org',
port: '',
pathname: '/v1/files/**',
},
],
},
};
export default withBundleAnalyzer(withSentryConfig(nextConfig, SentryWebpackPluginOptions));