Failed to work when react is external and loaded via standalone script
See original GitHub issueWith HTML template like:
<script src="https://cdn.jsdelivr.net/npm/react@16.12.0/umd/react.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/react-dom@16.12.0/umd/react-dom.production.min.js"></script>
And a webpack config including:
{
externals: {
react: 'React',
'react-dom': 'ReactDOM',
}
}
This plugin fails to work.
I’d like to dive into it a little, but with little knowledge about webpack I’m not sure I can find any valuable ideas.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:14 (6 by maintainers)
Top Results From Across the Web
React - issues with loading an external script - Stack Overflow
I did create my app with create-react-app and I don't succeed loading an external script. Surprisingly I didn't find any help online or...
Read more >Add React to a Website
Add React in One Minute · Step 1: Add a DOM Container to the HTML · Step 2: Add the Script Tags ·...
Read more >Iframes with React: Best Practices | by Andrea Perera
Embedding an Iframe inside a React app comes with some risks where Iframe will load content outside your control unless you take the...
Read more >The Recommended Setup - Single SPA
Alternatively, you may use global variables and <script> elements. An example of using SystemJS to load microfrontends with module federation can be found ......
Read more >ts-node - npm
There are 7251 other projects in the npm registry using ts-node. ... REPL; Write standalone scripts; Native ESM loader; Use third-party ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The PRODUCTION build will not work.
react-refresh 0.9.0 react 16.9.0 react-dom 16.9.0 @pmmmwh
externals still not work. I checked this in example/webpack-dev-server, add