From 535813f672c5ee409c611bbafb9370f5cfee123e Mon Sep 17 00:00:00 2001 From: jrmartin Date: Sat, 18 Jan 2025 13:53:28 -0500 Subject: [PATCH] #VFB-181 - Replace minify preset with minification plugins --- applications/virtual-fly-brain/client/.babelrc | 17 ++++++++++++----- .../virtual-fly-brain/client/package.json | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/applications/virtual-fly-brain/client/.babelrc b/applications/virtual-fly-brain/client/.babelrc index 1d3af7ab..aa7b6552 100644 --- a/applications/virtual-fly-brain/client/.babelrc +++ b/applications/virtual-fly-brain/client/.babelrc @@ -1,11 +1,17 @@ { "presets": [ - "@babel/preset-env", - "@babel/preset-react" + "@babel/preset-env", + "@babel/preset-react" ], "env": { - "production":{ - "presets": ["minify"] + "production": { + // Remove the minify preset and add individual minification plugins + "plugins": [ + "babel-plugin-transform-remove-console", // Remove console logs + "babel-plugin-minify-dead-code-elimination", // Remove dead code + "babel-plugin-minify-constant-folding", // Fold constants + "babel-plugin-transform-remove-debugger" // Remove debugger statements + ] } }, "plugins": [ @@ -13,7 +19,8 @@ "@babel/plugin-proposal-class-properties", "@babel/transform-runtime", [ - "module-resolver", { + "module-resolver", + { "root": ["./src"] } ] diff --git a/applications/virtual-fly-brain/client/package.json b/applications/virtual-fly-brain/client/package.json index d97bde0a..206fbf23 100644 --- a/applications/virtual-fly-brain/client/package.json +++ b/applications/virtual-fly-brain/client/package.json @@ -69,11 +69,11 @@ "@babel/preset-env": "^7.8.3", "@babel/preset-react": "^7.8.3", "@babel/runtime": "^7.8.3", + "babel-loader": "^8.2.3", "@typescript-eslint/eslint-plugin": "^5.57.0", "@typescript-eslint/parser": "^5.57.0", "awesome-typescript-loader": "^5.2.1", "babel-eslint": "^10.1.0", - "babel-loader": "^8.0.6", "babel-plugin-module-resolver": "^4.0.0", "babel-preset-minify": "^0.5.1", "clean-webpack-plugin": "^3.0.0",