HarveyD / react-component-library

A project skeleton to get your very own React Component Library up and running using Rollup, Typescript, SASS + Storybook
https://blog.harveydelaney.com/creating-your-own-react-component-library/
MIT License
790 stars 167 forks source link

"Module not found" on Code Splitting branch #14

Closed jcleyba closed 4 years ago

jcleyba commented 4 years ago

I've tried the code splitting branch on two different react/typescript projects and I'm always getting Module not found: Can't resolve 'react-component-library/build/TestComponent'

One project is a CRA starter and the other a Next.js starter.

Anyone else with the same problem?

HarveyD commented 4 years ago

I'll have a look at this tonight.

HarveyD commented 4 years ago

So, it seems the problem is that the rollup-plugin-postcss in combination with Rollup code splitting isn't playing nicely. If you look at the build output, it'll have a src directory with all the compiled code. All the files in src should just be in the top level of build directory.

I'm going to use the rollup-plugin-sass plugin on this branch until I can identify what's going wrong with rollup-plugin-postcss.

HarveyD commented 4 years ago

I've fix the issue on the branch.

Thank you @jcleyba for raising an issue. You've saved everyone else who was going to use that branch a lot of time!

jcleyba commented 4 years ago

Working as a charm! Thanks for the quick fix @HarveyD. I'll close this issue.