Skip to content

Commit

Permalink
Merge pull request #1544 from GowthamShanmugam/bz_2290675
Browse files Browse the repository at this point in the history
Optimizing the chunk size for production
  • Loading branch information
openshift-merge-bot[bot] authored Aug 22, 2024
2 parents 5937911 + 3f10be6 commit 4ef2973
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const NODE_ENV = (process.env.NODE_ENV ||
'development') as webpack.Configuration['mode'];
const PLUGIN = process.env.PLUGIN;
const OPENSHIFT_CI = process.env.OPENSHIFT_CI;
const isProduction = NODE_ENV === 'production';
const IS_PRODUCTION = NODE_ENV === 'production';

if (PLUGIN === undefined) {
process.exit(1);
Expand Down Expand Up @@ -87,7 +87,7 @@ const config: webpack.Configuration & DevServerConfiguration = {
{
loader: 'thread-loader',
options: {
...(!isProduction
...(!IS_PRODUCTION
? { poolTimeout: Infinity, poolRespawn: false }
: OPENSHIFT_CI
? {
Expand Down Expand Up @@ -156,13 +156,13 @@ const config: webpack.Configuration & DevServerConfiguration = {
],
// 'source-map' is recommended choice for production builds, A full SourceMap is emitted as a separate file.
// 'eval-source-map' is recommended for development but 'eval-cheap-module-source-map' is faster and gives better result.
devtool: isProduction ? 'source-map' : 'eval-cheap-module-source-map',
devtool: IS_PRODUCTION ? 'source-map' : 'eval-cheap-module-source-map',
optimization: {
chunkIds: 'named',
},
};

if (isProduction || process.env.DEV_NO_TYPE_CHECK !== 'true') {
if (IS_PRODUCTION || process.env.DEV_NO_TYPE_CHECK !== 'true') {
config.plugins?.push(
new ForkTsCheckerWebpackPlugin({
issue: {
Expand Down

0 comments on commit 4ef2973

Please sign in to comment.