Utilize Webpack 4 and Babel 7.
It will compile down to commonjs, and will require a peer dependancy of react, meaning it will use whatever version of react the host project is using. Hopefully this will minimize compatibility issues.
Based on this tutorial by codewithbernard
npm i
npm start
Edit src/index.js
(your component)
type:
npm run dev
Edit /srctest/app.js
to change the parent environment, pass in props, etc.
Build this project:
npm run build
Containing Services LocalStorage Service API service Utility Service