feature/IO-3614-March-2026-Tech-Debt - GraphQL-Request backend package bump
This commit is contained in:
@@ -47,33 +47,6 @@ const httpsCerts = {
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
const pathSeparatorPattern = String.raw`[\\/]`;
|
||||
|
||||
const escapeRegex = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
const packageChunkTest = (packageNames) => {
|
||||
const names = Array.isArray(packageNames) ? packageNames : [packageNames];
|
||||
|
||||
return new RegExp(
|
||||
`${pathSeparatorPattern}node_modules${pathSeparatorPattern}(?:${names
|
||||
.map((name) => name.split("/").map(escapeRegex).join(pathSeparatorPattern))
|
||||
.join("|")})(?:${pathSeparatorPattern}|$)`
|
||||
);
|
||||
};
|
||||
|
||||
const vendorCodeSplittingGroups = [
|
||||
{ name: "antd", test: packageChunkTest("antd"), priority: 100 },
|
||||
{ name: "react-redux", test: packageChunkTest("react-redux"), priority: 95 },
|
||||
{ name: "redux", test: packageChunkTest("redux"), priority: 90 },
|
||||
{ name: "lodash", test: packageChunkTest("lodash"), priority: 85 },
|
||||
{ name: "@sentry/react", test: packageChunkTest("@sentry/react"), priority: 80 },
|
||||
{ name: "@splitsoftware/splitio-react", test: packageChunkTest("@splitsoftware/splitio-react"), priority: 75 },
|
||||
{ name: "logrocket", test: packageChunkTest("logrocket"), priority: 70 },
|
||||
{ name: "firebase", test: packageChunkTest("@firebase"), priority: 65 },
|
||||
{ name: "markerjs2", test: packageChunkTest("markerjs2"), priority: 60 },
|
||||
{ name: "@apollo/client", test: packageChunkTest("@apollo/client"), priority: 55 },
|
||||
{ name: "libphonenumber-js", test: packageChunkTest("libphonenumber-js"), priority: 50 },
|
||||
{ name: "recharts", test: packageChunkTest("recharts"), priority: 45 }
|
||||
];
|
||||
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
// React Compiler is always enabled for production/test builds
|
||||
@@ -255,13 +228,27 @@ export default defineConfig(({ command, mode }) => {
|
||||
|
||||
build: {
|
||||
sourcemap: true,
|
||||
rolldownOptions: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
codeSplitting: {
|
||||
groups: vendorCodeSplittingGroups
|
||||
},
|
||||
comments: {
|
||||
legal: false
|
||||
manualChunks: {
|
||||
antd: ["antd"],
|
||||
"react-redux": ["react-redux"],
|
||||
redux: ["redux"],
|
||||
lodash: ["lodash"],
|
||||
"@sentry/react": ["@sentry/react"],
|
||||
"@splitsoftware/splitio-react": ["@splitsoftware/splitio-react"],
|
||||
logrocket: ["logrocket"],
|
||||
firebase: [
|
||||
"@firebase/analytics",
|
||||
"@firebase/app",
|
||||
"@firebase/firestore",
|
||||
"@firebase/auth",
|
||||
"@firebase/messaging"
|
||||
],
|
||||
markerjs2: ["markerjs2"],
|
||||
"@apollo/client": ["@apollo/client"],
|
||||
"libphonenumber-js": ["libphonenumber-js"],
|
||||
recharts: ["recharts"]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -269,6 +256,12 @@ export default defineConfig(({ command, mode }) => {
|
||||
cssMinify: "lightningcss"
|
||||
},
|
||||
|
||||
// Strip console/debugger in prod to shrink bundles
|
||||
esbuild: {
|
||||
// drop: mode === "production" ? ["console", "debugger"] : [],
|
||||
legalComments: "none" // Remove license comments in production
|
||||
},
|
||||
|
||||
optimizeDeps: {
|
||||
include: [
|
||||
"react",
|
||||
@@ -291,8 +284,8 @@ export default defineConfig(({ command, mode }) => {
|
||||
"@firebase/util",
|
||||
"styled-components"
|
||||
],
|
||||
rolldownOptions: {
|
||||
moduleTypes: { ".jsx": "jsx", ".tsx": "tsx" }
|
||||
esbuildOptions: {
|
||||
loader: { ".jsx": "jsx", ".tsx": "tsx" }
|
||||
},
|
||||
// Force styled-components to be pre-bundled and deduplicated
|
||||
force: mode === "development"
|
||||
|
||||
Reference in New Issue
Block a user