First of all thanks for the great component, and blog post, very useful and insightful.
I run into an error when running npm build to transpile the component in the dist folder.
Turns out the preset for babel, babel-preset-react-app was missing in the dev dependencies.
This can be installed as
npm install babel-preset-react-app --save-dev
So perhaps your create-component-lib script could be updated on line 34 to include that too.
The nice thing about installing react-scripts in the bash script is that this seemed to work for setting up the latest create-react-app v2 which supports css modules, so that's cool.
However thought I'd mentioned I ended up installing the official babel react presets,@babel/preset-react and @babel/core @babel/cli
So thought I'd mentioned it in case you want to add those to the script instead of the unofficial once.
For convenience, updated line in the script would look like this
npm i react react-dom react-scripts @babel/core @babel/cli @babel/preset-react rimraf --save-dev
Hope this helps