-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
executable file
·96 lines (89 loc) · 2.46 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/* eslint-disable @typescript-eslint/no-var-requires */
/** @type {import('next').NextConfig} */
const path = require('path');
const withPlugins = require('next-compose-plugins');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const { withSentryConfig } = require('@sentry/nextjs');
const moduleExports = {
sentry: {
hideSourseMaps: true,
},
};
const sentryWebpackPluginOptions = {
silent: true,
authToken: process.env.SENTRY_AUTH_TOKEN,
};
const bundleAnalyzer = withBundleAnalyzer({
compress: true,
webpack: (config) => {
const prod = process.env.NODE_ENV === 'production';
return {
...config,
mode: prod ? 'production' : 'development',
devtool: prod ? 'hidden-source-map' : 'eval',
};
},
});
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
presets: [
[
'next/babel',
{
'preset-env': {
modules: false,
},
},
],
],
typescript: {
ignoreBuildErrors: true, // TODO: 없애기
},
eslint: {
ignoreDuringBuilds: true, // TODO: 없애기
},
sassOptions: {
includePaths: [path.join(__dirname, 'styles')],
prependData: `
@import "src/styles/main.scss";
@import "src/styles/_mixin.scss";
@import "src/styles/_typography.scss";
@import "src/styles/_grid.scss";
@import "src/styles/_loading.scss";
`,
},
env: {
API_URL: process.env.API_URL,
AI_API_URL: process.env.AI_API_URL,
OAUTH_URL: process.env.OAUTH_URL,
OAUTH_CLIENT_ID: process.env.OAUTH_CLIENT_ID,
OAUTH_REDIRECT_URI: process.env.OAUTH_REDIRECT_URI,
OAUTH_STATE: process.env.OAUTH_STATE,
OAUTH_SCOPE: process.env.OAUTH_SCOPE,
CLIENT_URL: process.env.CLIENT_URL,
SENTRY_DSN: process.env.SENTRY_DSN,
SENTRY_AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN,
OAUTH_LOGOUT_URL: process.env.OAUTH_LOGOUT_URL,
LOGOUT_REDIRECT_URI: process.env.LOGOUT_REDIRECT_URI,
LOGOUT_CLIENT_ID: process.env.LOGOUT_CLIENT_ID,
GA_ID: process.env.GA_ID,
},
images: {
domains: [
'images.unsplash.com',
'user-images.githubusercontent.com',
'webserver0712.s3.ap-northeast-2.amazonaws.com',
'ai-image-bucket.s3.amazonaws.com',
],
imageSizes: [32, 48, 64, 96, 128, 256, 360],
deviceSizes: [640, 768, 828, 1024, 1920],
},
};
module.exports = withSentryConfig(
withPlugins([nextConfig, bundleAnalyzer]),
moduleExports,
sentryWebpackPluginOptions,
);