-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathnext.config.js
55 lines (46 loc) · 1.33 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
/* eslint-disable @typescript-eslint/no-var-requires */
require("dotenv").config();
const webpack = require("webpack");
const { withSentryConfig } = require("@sentry/nextjs");
const moduleExports = {
// next config
};
const sentryWebpackPluginOptions = {
// sentry config
};
const withPlugins = require("next-compose-plugins");
module.exports = async (phase, { defaultConfig }) => {
delete defaultConfig["webpackDevMiddleware"];
delete defaultConfig["configOrigin"];
delete defaultConfig["target"];
delete defaultConfig["webpack5"];
delete defaultConfig.amp["canonicalBase"];
const localConfig = {
assetPrefix: "/",
experimental: {},
images: {
domains: ["cdn.buymeacoffee.com", "localhost"],
},
i18n: {
locales: ["en", "fr", "es", "it", "nl", "ru", "pt", "de", "sk", "zh"],
defaultLocale: "en",
},
webpack: (config, { isServer, buildId }) => {
config.plugins.push(
new webpack.DefinePlugin({
"process.env.SENTRY_RELEASE": JSON.stringify(buildId),
})
);
if (!isServer) {
config.resolve.alias["@sentry/node"] = "@sentry/browser";
}
return config;
},
};
return {
...withPlugins([], withSentryConfig(moduleExports, sentryWebpackPluginOptions))(phase, {
config: defaultConfig,
}),
...localConfig,
};
};