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

fix: don't generate report.html file for RC and Production #3125

Merged
merged 4 commits into from
Sep 12, 2024

Conversation

mudassir-hafeez
Copy link
Contributor

@mudassir-hafeez mudassir-hafeez commented Aug 30, 2024

What are the relevant tickets?

#5265

Description (What does it do?)

This PR ensures that the report.html file generated by Webpack Bundle Analyzer is not served publicly in RC and Production environments. The file will now only be generated when the WEBPACK_ANALYZE environment variable is explicitly set to True during local development.

Screenshots (if appropriate):

  • Desktop screenshots
  • Mobile width screenshots

How can this be tested?

  1. Local Testing:

    • Set WEBPACK_ANALYZE=True in your .env file to confirm that the report.html file is generated.
    • Run the webpack bundle with:
      node node_modules/webpack/bin/webpack.js --config webpack.config.prod.js --bail
    • Ensure that the report.html file is created under /static/bundles/.
  2. Local Testing Without Analysis:

    • Remove or leave WEBPACK_ANALYZE unset, and confirm that the report.html file is not generated by running the same command as above.
  3. RC/Production Testing:

Additional Context

  • The report file can still be generated locally for debugging purposes using the WEBPACK_ANALYZE flag.

@mudassir-hafeez mudassir-hafeez changed the title fix: block report.html file access of Webpack bundles fix: don't generate report.html file for RC and Production Sep 10, 2024
@asadali145 asadali145 self-assigned this Sep 12, 2024
Copy link
Contributor

@asadali145 asadali145 left a comment

Choose a reason for hiding this comment

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

LGTM!

@mudassir-hafeez mudassir-hafeez merged commit 1205de1 into master Sep 12, 2024
7 checks passed
@mudassir-hafeez mudassir-hafeez deleted the mudassir/block-report-route-accessed branch September 12, 2024 10:43
@odlbot odlbot mentioned this pull request Sep 18, 2024
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants