Skip to content

Commit 950af7e

Browse files
authored
Merge pull request Expensify#71646 from callstack-internal/perf/production-bundle-cleanup
[No QA] perf: production bundle cleanup
2 parents 887979d + d4f382d commit 950af7e

4 files changed

Lines changed: 53 additions & 8 deletions

File tree

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ require('dotenv').config();
33
const IS_E2E_TESTING = process.env.E2E_TESTING === 'true';
44

55
const ReactCompilerConfig = {
6-
target: '18',
6+
target: '19',
77
environment: {
88
enableTreatRefLikeIdentifiersAsRefs: true,
99
},

config/webpack/webpack.common.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import CopyPlugin from 'copy-webpack-plugin';
33
import dotenv from 'dotenv';
44
import fs from 'fs';
55
import HtmlWebpackPlugin from 'html-webpack-plugin';
6+
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
67
import path from 'path';
78
import TerserPlugin from 'terser-webpack-plugin';
89
import type {Class} from 'type-fest';
@@ -166,6 +167,7 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment):
166167
// eslint-disable-next-line @typescript-eslint/naming-convention
167168
__DEV__: /staging|prod|adhoc/.test(file) === false,
168169
}),
170+
...(isDevelopment ? [] : [new MiniCssExtractPlugin()]),
169171

170172
// This allows us to interactively inspect JS bundle contents
171173
...(process.env.ANALYZE_BUNDLE === 'true' ? [new BundleAnalyzerPlugin()] : []),
@@ -232,7 +234,7 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment):
232234
},
233235
{
234236
test: /\.css$/i,
235-
use: ['style-loader', 'css-loader'],
237+
use: isDevelopment ? ['style-loader', 'css-loader'] : [MiniCssExtractPlugin.loader, 'css-loader'],
236238
},
237239
{
238240
test: /\.(woff|woff2)$/i,

package-lock.json

Lines changed: 45 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"compress-svg": "npx ts-node scripts/compressSvg.ts --dir assets/images"
8181
},
8282
"dependencies": {
83+
"@babel/runtime": "^7.25.0",
8384
"@dnd-kit/core": "^6.3.1",
8485
"@dnd-kit/modifiers": "^9.0.0",
8586
"@dnd-kit/sortable": "^10.0.0",
@@ -161,6 +162,7 @@
161162
"react-dom": "19.0.0",
162163
"react-error-boundary": "^4.0.11",
163164
"react-fast-pdf": "^1.0.29",
165+
"react-is": "^18.3.1",
164166
"react-map-gl": "^7.1.3",
165167
"react-native": "0.79.2",
166168
"react-native-advanced-input-mask": "1.4.4",
@@ -226,7 +228,6 @@
226228
"@babel/preset-flow": "^7.12.13",
227229
"@babel/preset-react": "^7.10.4",
228230
"@babel/preset-typescript": "^7.21.5",
229-
"@babel/runtime": "^7.25.0",
230231
"@babel/traverse": "^7.22.20",
231232
"@babel/types": "^7.22.19",
232233
"@callstack/reassure-compare": "^1.0.0-rc.4",
@@ -298,7 +299,7 @@
298299
"babel-jest": "29.7.0",
299300
"babel-loader": "^9.1.3",
300301
"babel-plugin-module-resolver": "^5.0.0",
301-
"babel-plugin-react-compiler": "^19.0.0-beta-8a03594-20241020",
302+
"babel-plugin-react-compiler": "^19.0.0-beta-ebf51a3-20250411",
302303
"babel-plugin-react-native-web": "^0.18.7",
303304
"babel-plugin-transform-remove-console": "^6.9.4",
304305
"clean-webpack-plugin": "^4.0.0",
@@ -337,6 +338,7 @@
337338
"jest-when": "^3.5.2",
338339
"link": "^2.1.1",
339340
"memfs": "^4.6.0",
341+
"mini-css-extract-plugin": "^2.9.4",
340342
"nitrogen": "0.29.4",
341343
"onchange": "^7.1.0",
342344
"openai": "5.5.1",
@@ -346,7 +348,6 @@
346348
"prettier": "3.5.3",
347349
"react-compiler-healthcheck": "^19.0.0-beta-8a03594-20241020",
348350
"react-compiler-runtime": "^19.0.0-beta-8a03594-20241020",
349-
"react-is": "^18.3.1",
350351
"react-native-clean-project": "^4.0.0-alpha4.0",
351352
"react-refresh": "^0.14.2",
352353
"react-test-renderer": "19.0.0",

0 commit comments

Comments
 (0)