forked from auralous/auralous
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
73 lines (71 loc) · 2.03 KB
/
next.config.js
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
/* eslint-disable @typescript-eslint/no-var-requires */
const SentryWebpackPlugin = require("@sentry/webpack-plugin");
const { name, version } = require("./package.json");
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
module.exports = withBundleAnalyzer({
env: {
APP_URI: process.env.APP_URI,
API_URI: process.env.API_URI,
FACEBOOK_APP_ID: process.env.FACEBOOK_APP_ID,
GOOGLE_API_KEY: process.env.GOOGLE_API_KEY,
SPOTIFY_CLIENT_ID: process.env.SPOTIFY_CLIENT_ID,
WEBSOCKET_URI: process.env.WEBSOCKET_URI,
FATHOM_SITE_ID: process.env.FATHOM_SITE_ID,
SENTRY_DSN: process.env.SENTRY_DSN,
SENTRY_RELEASE: `${name}@${version}`,
},
experimental: {
plugins: true,
productionBrowserSourceMaps: true,
},
webpack: (config, options) => {
if (!options.isServer) {
config.resolve.alias["@sentry/node"] = "@sentry/browser";
}
if (process.env.NODE_ENV === "production") {
config.devtool = "hidden-source-map";
if (process.env.SENTRY_AUTH_TOKEN) {
process.env.SENTRY_ORG = "hoangvvo";
process.env.SENTRY_PROJECT = "stereo-web";
config.plugins.push(
new SentryWebpackPlugin({
include: ".next",
ignore: ["node_modules"],
stripPrefix: ["webpack://_N_E/"],
urlPrefix: "~/_next",
release: `${name}@${version}`,
silent: true,
})
);
} else {
console.warn(
"Missing SENTRY_AUTH_TOKEN environment variables: Source Maps will not be uploaded."
);
}
}
config.module.rules.push({
test: /\.svg$/,
use: [
{
loader: "@svgr/webpack",
options: { svgoConfig: { plugins: { removeViewBox: false } } },
},
],
});
return config;
},
devIndicators: {
autoPrerender: false,
},
async redirects() {
return [
{
source: "/contact",
destination: "/support",
permanent: true,
},
];
},
});