Closed kestred closed 5 years ago
@kestred This isn't a problem with postcss-css-variables
. It looks like postcss-loader
for webpack processes each file individually. So when it goes over index.css
, none of the variables are defined from my-dependency/dist/my-dependency.css
.
You may want to use postcss-import
before postcss-css-variables
and use some @import
statements within index.css
instead.
When using variables from a stylesheet imported from a dependency,
postcss-css-variables
doesn't find variables defined in an imported stylesheet, even though the variables are present in the output.I apologize in advanced if you tell me some simple change to my webpack config fixes this 😅 .
Minimal Example
package.json
webpack.config.js
index.js
index.css