I have a components library made with styled components and published on npm. To have better class names, I'm using babel-plugin-styled-components, which works well if I'm working locally. If I install the npm package on another project, I get this error: export 'css' (imported as 'css') was not found in 'styled-components/macro' (possible exports: default). Does anyone have an idea why and how I could fix it?
This is my babel config:
.babelrc:
{
"plugins": [
[
"babel-plugin-styled-components",
{
"fileName": false,
"pure": true,
"meaninglessFileNames": [
"index",
"styles"
]
}
]
]
}
babel-plugin-macros.config.js
const config = {
fileName: false,
displayName: true,
meaninglessFileNames: ["index", "styles"],
}
module.exports = { styledComponents: config }
Thanks for your answers!