refactor: remove webpack dependencies and update documentation for migration to esbuild

This commit is contained in:
Simon Larsen 2025-06-09 20:04:36 +01:00
parent f5e6b04070
commit 1392aba0dc
No known key found for this signature in database
GPG key ID: 96C5DCA24769DBCA
8 changed files with 11 additions and 71 deletions

View file

@ -69,12 +69,12 @@ RUN npm install
# - 3003: accounts
EXPOSE 3003
RUN npm i -D webpack-cli
{{ if eq .Env.ENVIRONMENT "development" }}
RUN mkdir /usr/src/app/dev-env
RUN touch /usr/src/app/dev-env/.env
RUN npm i -D webpack-dev-server
#Run the app
CMD [ "npm", "run", "dev" ]

View file

@ -35,7 +35,7 @@ See the section about [deployment](https://facebook.github.io/create-react-app/d
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
Instead, it will copy all the configuration files and the transitive dependencies ( Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.

View file

@ -67,13 +67,13 @@ RUN npm install
# - 3158: AdminDashboard
EXPOSE 3158
RUN npm i -D webpack-cli
{{ if eq .Env.ENVIRONMENT "development" }}
#Run the app
RUN mkdir /usr/src/app/dev-env
RUN touch /usr/src/app/dev-env/.env
RUN npm i -D webpack-dev-server
CMD [ "npm", "run", "dev" ]
{{ else }}
# Copy app source

View file

@ -35,7 +35,7 @@ See the section about [deployment](https://facebook.github.io/create-react-app/d
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
Instead, it will copy all the configuration files and the transitive dependencies ( Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.

View file

@ -61,13 +61,13 @@ RUN npm install
# - 3009: Dashboard
EXPOSE 3009
RUN npm i -D webpack-cli
{{ if eq .Env.ENVIRONMENT "development" }}
#Run the app
RUN mkdir /usr/src/app/dev-env
RUN touch /usr/src/app/dev-env/.env
RUN npm i -D webpack-dev-server
CMD [ "npm", "run", "dev" ]
{{ else }}
# Copy app source

View file

@ -35,7 +35,7 @@ See the section about [deployment](https://facebook.github.io/create-react-app/d
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
Instead, it will copy all the configuration files and the transitive dependencies ( Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.

View file

@ -1,60 +0,0 @@
#!/bin/bash
# Webpack to ESBuild Migration Cleanup Script
# This script removes webpack dependencies and configurations
echo "🧹 Starting webpack to esbuild migration cleanup..."
# Services to clean up
SERVICES=("Dashboard" "Accounts" "AdminDashboard" "StatusPage")
for service in "${SERVICES[@]}"; do
echo "📦 Cleaning up $service..."
if [ -d "./$service" ]; then
cd "./$service"
# Remove webpack configuration file
if [ -f "webpack.config.js" ]; then
echo " 🗑️ Removing webpack.config.js"
rm webpack.config.js
fi
# Remove webpack-related dependencies
echo " 📦 Removing webpack dependencies..."
npm uninstall \
webpack \
webpack-bundle-analyzer \
ts-loader \
css-loader \
style-loader \
sass-loader \
file-loader \
cross-env \
react-app-rewired 2>/dev/null || true
# Clean up any webpack-related build artifacts
if [ -d "dist" ]; then
echo " 🗑️ Cleaning old dist directory"
rm -rf dist
fi
cd ..
else
echo " ⚠️ Directory $service not found, skipping..."
fi
done
echo "✅ Webpack to esbuild migration cleanup completed!"
echo ""
echo "📝 Summary of changes:"
echo " • Removed webpack.config.js files"
echo " • Uninstalled webpack and related dependencies"
echo " • Created esbuild.config.js configurations"
echo " • Updated package.json build scripts"
echo ""
echo "🚀 You can now use the following commands:"
echo " • npm run dev-build - Development build"
echo " • npm run build - Production build"
echo " • npm run build:watch - Development build with watch mode"
echo " • npm run analyze - Production build with bundle analysis"

View file

@ -68,12 +68,12 @@ EXPOSE 3105
# API
EXPOSE 3106
RUN npm i -D webpack-cli
{{ if eq .Env.ENVIRONMENT "development" }}
RUN mkdir /usr/src/app/dev-env
RUN touch /usr/src/app/dev-env/.env
RUN npm i -D webpack-dev-server
#Run the app
CMD [ "npm", "run", "dev" ]
{{ else }}