Closed leon-up9 closed 2 years ago
I cannot reproduce this, and your comment seems to be contradictory. Your "how used in a code" snippet shows exactly how you'd use a CSS module, so if you don't want that behavior, I don't see why you'd be writing that.
Even setting --css-modules
to true
won't break this, as you're using a side-effectual import. There's no way for this to be treated as a module.
// index.jsx
import './styles.sass';
export default function Foo() {
return <h1 class="test">Hello World</h1>
}
// styles.sass
.test
color: blue
I cannot reproduce this, and your comment seems to be contradictory. Your "how used in a code" snippet shows exactly how you'd use a CSS module, so if you don't want that behavior, I don't see why you'd be writing that.
Even setting
--css-modules
totrue
won't break this, as you're using a side-effectual import. There's no way for this to be treated as a module.// index.jsx import './styles.sass'; export default function Foo() { return <h1 class="test">Hello World</h1> }
// styles.sass .test color: blue
i have edited my question and tried to clerify. when i have a similiar code to your example it still compiles as a module.(which should not, corrent?) and since in the html the class name is test and not .h45gy (for example) the style is not applied
You'll need to provide a reproduction. I cannot follow from your description.
What I provided does not get treated as a module.
Closing due to no response and not enough information to go on.
styles.sass is still parsed as css module. only using --css-modules false works.
expected behavior : to compile as a module only the module.sass extention
when used in a code :
and not complie regular index.sass as modules
which used as:
any workaround?