Closed kbruneel closed 3 years ago
Hi,
When I do: import s1 from "./button.css";
import s1 from "./button.css";
And then try: s1.button
s1.button
This returns undefined.
undefined
When I console.log(s1) I get:
console.log(s1)
{_getContent: ƒ, _getCss: ƒ, _insertCss: ƒ} _getContent: ƒ () _getCss: ƒ () _insertCss: ƒ (options) __proto__: Object
button.css contains:
.button { ... }
In my webpack config I have:
{ test: /\.(css|scss)$/, use: [ 'isomorphic-style-loader', { loader: "css-loader", options: { importLoaders: 1 } }, 'postcss-loader' ] }
I'm really out of ideas of what I'm doing wrong. Thanks for your help! Karel
Hi @kbruneel whats version of css-loader do you use?
Seeing the same issue. Tried with css-loader 3.6.0 and 5.0.1.
Fixed by adding "modules: true" to css-loader options.
Closing, as this issues has a solution.
Hi,
When I do:
import s1 from "./button.css";
And then try:
s1.button
This returns
undefined
.When I
console.log(s1)
I get:button.css contains:
In my webpack config I have:
I'm really out of ideas of what I'm doing wrong. Thanks for your help! Karel