-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.ts
39 lines (33 loc) · 1.19 KB
/
next.config.ts
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
import withVercelToolbar from "@vercel/toolbar/plugins/next";
import type { NextConfig } from "next";
import headers from "./headers.config";
import VcfPngResolverPlugin from "./loaders/resolve-vcf-png";
import type {} from "./reset";
import withSentry, { reportTunnel } from "./sentry.next.config";
const nextConfig: NextConfig = {
async rewrites() {
return [reportTunnel()].filter(Boolean);
},
webpack: (config) => {
config.module.rules.push(
{ test: /\.ttf$/, use: "./loaders/ttf.mjs" },
{ test: /\.vcf$/, use: "./loaders/vcf.mjs" },
{ test: /\.vcf\.png$/, use: "./loaders/vcf.png.mjs" },
{ test: /\.yml$/, use: "./loaders/yaml.mjs" },
);
config.resolve.plugins.unshift(new VcfPngResolverPlugin());
config.resolve.alias ??= {};
if (process.env.NODE_ENV !== "development") {
config.resolve.alias["@spotlightjs/spotlight"] = false;
config.resolve.alias["@vercel/toolbar"] = false;
}
return config;
},
headers,
};
export default [
withSentry,
process.env.NODE_ENV === "development" && withVercelToolbar({ devServerPort: 3001 }),
]
.filter(Boolean)
.reduceRight((nextConfig, transform) => transform(nextConfig), nextConfig);