Document or remove dependency on styled-components
grrowl opened this issue · 4 comments
We should add explanation of why the requirement on styled-components exists. In my project, I use @emotion/styled
, so I get a warning emitted on compilation in dev
[ warn ] ./node_modules/react-ssr-prepass/dist/react-ssr-prepass.development.js
Module not found: Can't resolve 'styled-components' in '/Users/tom/Documents/projects/holy-rabbit/app/node_modules/react-ssr-prepass/dist'
[ info ] ready on http://localhost:3000
Sorry, I did forget to add the dependency. That being said, you can just stub out styled-components in Webpack as an empty module and it’ll just skip the optimisation.
I’ll probably refine how this works in the future
+1 Also seeing this!
FWIW I have a published fork with this optimization removed entirely: master...rtsao:master
https://www.npmjs.com/package/@rtsao/react-ssr-prepass
I wasn't sure how best to resolve this upstream without removing the functionality entirely. Perhaps something with __non_webpack_require__
?
I'm still thinking how to resolve this properly, but this might require some API changes and a major bump, so I'll update this issue shortly.