chore: configure webpack for production optimization
- Added a webpack configuration to utilize terser-webpack-plugin for minifying JavaScript files in production builds, ensuring no comments are included in the output.
This commit is contained in:
parent
44d7a52790
commit
420c481b84
@ -19,6 +19,22 @@ const nextConfig: NextConfig = {
|
|||||||
// },
|
// },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
webpack: (config, { dev, isServer }) => {
|
||||||
|
if (!dev && !isServer) {
|
||||||
|
config.optimization.minimizer = config.optimization.minimizer || []
|
||||||
|
config.optimization.minimizer.push(
|
||||||
|
new (require('terser-webpack-plugin'))({
|
||||||
|
terserOptions: {
|
||||||
|
format: {
|
||||||
|
comments: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
extractComments: false,
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return config
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default nextConfig
|
export default nextConfig
|
||||||
|
|||||||
@ -45,6 +45,7 @@
|
|||||||
"@types/react-dom": "^19",
|
"@types/react-dom": "^19",
|
||||||
"prisma": "^6.7.0",
|
"prisma": "^6.7.0",
|
||||||
"tailwindcss": "^4",
|
"tailwindcss": "^4",
|
||||||
|
"terser-webpack-plugin": "^5.3.14",
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user