create-react-library
create-react-library copied to clipboard
Problem with CSS when publishing
Hi,
I am building a simple button using create-react-library. However, when publishing to npm this button all my styling is lost while the rest of my code is coming through. I am not sure how this exactly is happening.
My repo can be found here
I am using several dependencies for my project (and added them as peerdependencies in package.json): "react": "^16.0.0", "@octokit/core": "^3.2.1", "@primer/components": "^20.3.0", "@primer/octicons": "^11.0.0", "styled-components": "^5.2.1"
The weird thing is that I can see my button rendered in /example but not when importing it into a fresh project created using create-react-app. I am not sure on how to debug this.
Hi,
I had the same problem, when you build your library it will create an index.css, just import that in your application
Same issue here. I even tried sticking all my css into a file named index.css in root, so that they could be referenced after the publish, but even that fails.
I am facing the same issue, for multiple classNames.
className={styles.redLightBlink + " " + styles.dotPosition} or className={[styles.redLightBlink, styles.dotPosition].join(' ')}
Both are working fine in example code, but doesn't reflect the css of multiple classes in published plugin, when we install and import the same in actual project.
This project is no longer maintained. Please see the note at the top of the readme for alternatives.