I am learning how to use postcss-bem to generate css files in bem style, but I wonder if there're some package like the CSS-Modules or Postcss-JS, that I could use to doing something like below:
const ReactComp extends React.Component{
render(){
let styles = './postcss-bem.css'
return <div class={styles.blockname}>something</div>
}
}
I found this feature on the documents of CSS-Modules and Postcss-JS but when I try to use webpack's postcss-loader with postcss-JS to parser the postcss-bem.css
loaders: ["style-loader","css-loader","postcss-loader?parser=postcss-js"]
But I got the error like this
Module build failed: SyntaxError: Unexpected token ILLEGAL
Am I doing it wrong?