Skip to content

Commit 0763876

Browse files
committed
#351 feat(fe): chunk 최적화 간단화
1 parent 133997f commit 0763876

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

src/frontend/apps/web/next.config.mjs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
// import withBundleAnalyzer from '@next/bundle-analyzer';
22
import TerserPlugin from 'terser-webpack-plugin';
33

4-
const mode = process.env.NODE_ENV || 'development';
4+
const mode = process.env.NEXT_NODE_ENV;
55

66
/** @type {import('next').NextConfig} */
77
const nextConfig = {
88
transpilePackages: ['@workspace/ui'],
99
images: {
10+
// eslint-disable-next-line no-undef
1011
domains: [process.env.NEXT_PUBLIC_S3_BUCKET_NAME || 'default-domain.com'],
1112
},
12-
webpack: (config, { isServer }) => {
13-
if (!isServer && mode === 'production') {
14-
config.optimization.splitChunks = {
15-
chunks: 'all',
16-
};
17-
18-
config.optimization.minimizer = [
19-
new TerserPlugin({
20-
terserOptions: {
21-
compress: {
22-
drop_console: true,
23-
},
24-
},
25-
}),
26-
];
27-
}
28-
return config;
13+
optimization: {
14+
splitChunks: {
15+
chunks: 'all',
16+
},
17+
minimizer:
18+
mode === 'production'
19+
? [
20+
new TerserPlugin({
21+
terserOptions: {
22+
compress: {
23+
drop_console: true,
24+
},
25+
},
26+
}),
27+
]
28+
: [],
2929
},
3030
};
3131

0 commit comments

Comments
 (0)