File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// import withBundleAnalyzer from '@next/bundle-analyzer';
22import 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 } */
77const 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
You can’t perform that action at this time.
0 commit comments