thgh / rollup-plugin-scss

Rollup and compile multiple .scss, .sass and .css imports
MIT License
134 stars 47 forks source link

[!] Error: 'default' is not exported by src/alert.scss #19

Closed tavurth closed 6 years ago

tavurth commented 6 years ago

Sample repository

import styles from './styles.scss';

Causes the error: [!] Error: 'default' is not exported by src/styles.scss

thgh commented 6 years ago

Please check out the usage section in the readme.

tavurth commented 6 years ago

Changing the command to

import './styles.scss'
...
<div className='alert' />

Seems to have a different result, in that the class is not loaded. Any ideas?

thgh commented 6 years ago

You might be looking for css modules, modular css or styled components. This package simply combines the imported & compiled scss files into bundle.css

elevatebart commented 4 years ago

Hello @thgh

I am looking for this as well. According to https://css-tricks.com/getting-javascript-to-talk-to-css-and-sass/ you can make scss and js talk this way. I understand it was a choice not to make it work at first but could it be added?

Thank you for the great lib