This project contains an example of how to build a component in react with Parcel2 that can be embedded as a global script in other, non-react pages.
It's a response to this stackoverflow question.
- Run
yarnto install dependencies - Run
yarn build:widgetto build the react code with parcel. This will output a.cssand .jsfile totest-consumer/dist-widgetfolder. - Run
yarn serveto servetest-consumer/index.htmlat http://localhost:8080. This page is vanilla html that embeds the build.jsand.cssfiles built in step #2