Skip to content

Add CRA 5 production build guidance - #741

Open
PVillarmarzo wants to merge 2 commits into
masterfrom
pvill/cra5-build-compatibility
Open

Add CRA 5 production build guidance#741
PVillarmarzo wants to merge 2 commits into
masterfrom
pvill/cra5-build-compatibility

Conversation

@PVillarmarzo

Copy link
Copy Markdown
Contributor

Summary

Adds documentation for the Create React App 5 production-build compatibility issue when consuming Reveal SDK from npm.

Changes

  • Added a CRA 5 entry to Known Issues describing the production-build behavior and the validated externals + self-hosted IIFE workaround.
  • Added a short warning in Getting Started with React linking to the Known Issues guidance.
  • Added a cross-reference in the 2.0 Upgrade Guide for applications migrating from the legacy script-based client to the npm package.

Validation

  • git diff --check
  • Docusaurus production build completed successfully for English and Japanese.

@zdrawku zdrawku left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@PVillarmarzo, please address this:

  1. Markdown list is broken by the unindented code fences.

The fenced blocks in steps 2 and 3 start at column 0, which closes the ordered list. As rendered, the <script> snippet and the config.externals snippet fall outside the list, and step 3/4 restart numbering at 1. instead of continuing. Indenting the continuation content by 3 spaces keeps them inside their list items:

Suggestions:

  • Add the IIFE bundle to public/index.html:

    <script src="%PUBLIC_URL%/reveal/reveal-sdk.js"></script>
  • Configure Webpack externals in your CRA override:

    config.externals = {
        ...(config.externals || {}),
        "reveal-sdk": "Reveal",
    };

Same treatment is needed for steps 1 and 4.

  1. The CRA override assumes the reader is already on craco or react-app-rewired, but stock CRA has no override hook, so this step is a dead end for them, no? Naming the tool and the file (e.g. craco.config.js via webpack.configure) would make it actionable. @MLopezIG what do you think?

  2. Add JP equivalent of your changes please

@PVillarmarzo

Copy link
Copy Markdown
Contributor Author

Thanks! I addressed the review feedback and pushed the updates.

Fixed the Markdown list nesting.
Made the CRA override steps actionable using the validated react-app-rewired setup.
Added the Japanese equivalents.

The docs build passes for both EN and JA.

@PVillarmarzo
PVillarmarzo requested a review from zdrawku September 1, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants