Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(webpack): further simplify our config #11123

Merged
merged 14 commits into from
May 14, 2024
Merged

chore(webpack): further simplify our config #11123

merged 14 commits into from
May 14, 2024

Conversation

LeoMcA
Copy link
Member

@LeoMcA LeoMcA commented May 14, 2024

Summary

https://mozilla-hub.atlassian.net/browse/MP-1132
Follow up to #11099

Problem

Our webpack and client dev config is overcomplicated as a result of using create react app.

Solution

Rip out things we're not using, hard code options, use defaults where they're good enough:

  • chore(webpack): remove DISABLE_NEW_JSX_TRANSFORM option
  • chore(webpack): remove FAST_REFRESH option
  • chore(webpack): remove InterpolateHtmlPlugin
  • chore(webpack): remove ModuleScopePlugin
  • chore(webpack): remove ModuleNotFoundPlugin
  • chore(webpack): directly import fork-ts-checker-webpack-plugin
  • chore(webpack): remove create-react-app eslint config, use defaults
  • chore(webpack): import chalk directly
  • chore(webpack): remove react-dev-utils imports from build script
  • chore(webpack): remove react-dev-utils imports from start script
  • chore(webpack): remove react-dev-utils imports from dev server config
  • chore(webpack): remove remnants of PUBLIC_URL and hard code
  • chore(webpack): remove react-dev-utils

How did you test this change?

No change to our prod code can be verified:

git checkout 4249546243cc16def100bfd2800dbecc6a9056b0
yarn && yarn build:client
rm -rf client/build.main
mv client/build client/build.main
git checkout webpack-cleanup-2
yarn build:client
diff -r client/build/ client/build.main/

The diff should exit with no output, showing the webpack output hasn't changed.

For local development, I ran yarn dev, and tested across various pages across localhost:3000 and localhost:5042. I also introduced various typescript and eslint errors into the client code to verify those error/warning messages were shown and failed the build as before.

@LeoMcA LeoMcA requested review from mdn-bot and a team as code owners May 14, 2024 12:38
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label May 14, 2024
Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM, and I compared a local en-US build from this branch with another one from main and saw no differences.

@LeoMcA LeoMcA merged commit 34512e7 into main May 14, 2024
16 checks passed
@LeoMcA LeoMcA deleted the webpack-cleanup-2 branch May 14, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants