-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How do you make Rollup to watch for changes in sass partials with this? #3
Comments
In the project I'm using this for, Now, to solve your situation, it would be interesting to see if the sass compiler returns a list of imported files and if it's possible to add these as modules such that rollup-watch can watch them. Do you have any idea about that? |
Ups. Sorry, I redacted an answer to this a few days ago, for I forgot to send it ^_^U. You helped so much with that answer, thanks! In fact, one of my problems was caused by certain part of the
// entry.js
import './reset.css' I understood here: «You need to import your styles in your JavaScript entry file with this plugin». So now I ended with an folder structure where I have a folder for each component and in that folder I have the proper So, actually, at least to this simple exercise/project, I'm not even using partials, because organizating the SCSS this way, I don't need it. When I need to do something more complex, maybe I will need partials for it, and yet, solve this problem. But, for now, I'm good ;). And yes, obviously, there was the Many thanks again, @thgh 👍 . And sorry again for my delay :(. Note: if I deal with this situation in the future and get it solved, I will tell you (if I remember :þ). |
A somewhat dirty solution is to use the provided watch option, something like this: |
I have already thrown hours into this and I can't figure it out.
This plugin works great with
rollup-watch
when you change the main.scss
file, which you are importing in yourindex.js
(or whatever your entry point is), but... how you make it to rebundle when you change something in any of your partials?If you modularize your sass, maybe you don't edit your
main.scss
file at all. Mine is just a list of@import
sentences... So, I import only this file and it calls all the partials. But... it only rebundles if you change the main scss file, so... it renders a bit useless/frustrating.I guess you're using it and, I hope, you're using partials, so, how you do it?
Any help, please? Thanks :D.
My
package.json
important part looks like this:In
rollup.config.js
myrollup-plugin-css
is:And, of course, in my
index.jsx
I have:The text was updated successfully, but these errors were encountered: