I've created a create-react-app simple application (as a lib) and want to load it inside an HTML page as an external script.
I created a create-react-app with the command npx create-react-app my-lib
Changed my-lib/src/index.js
to this:
my-lib
directory I run yarn build
. This generated the following production files:my-lib
.I'm getting the following error:
Production build creates 2 JS files i.e. chunk.js and main.js so we need to import both in index.html file
Please try this way