node-sass-chokidar icon indicating copy to clipboard operation
node-sass-chokidar copied to clipboard

Watch a directory but only rebuild index.scss

Open emilkarl opened this issue 7 years ago • 5 comments

I want to watch my styles directory for changes but only rebuild index.scss to css.

I got a styles structure looking like this...

styles
    ├── index.css
    ├── index.scss
    ├── sections
    │   └── header.scss
    └── shared
        ├── colors.scss
        └── page.scss

emilkarl avatar Sep 23 '18 12:09 emilkarl

I have the same issue with node-sass-chokidar. In my style directory I'm using a global.sass file that is only a list of @import of other files in the same directory. Modifying one of these imported files does nothing when watching global.sass. @michaelwayman is impossible to extend the watching to imported files when watching a global/index/main/younameit file with imports?

laurentpayot avatar Jun 18 '20 10:06 laurentpayot

Can someone please give a small example of this and the version of the package/version of node/os you are using?

michaelwayman avatar Jun 18 '20 17:06 michaelwayman

I will try to fix it on the chokidar side of node-sass. But give me a project structure or something to work off of

michaelwayman avatar Jun 18 '20 17:06 michaelwayman

Sure, will try to set up a little example asap.

laurentpayot avatar Jun 19 '20 07:06 laurentpayot

@michaelwayman I've just created this repo: https://github.com/laurentpayot/node-sass-chokidar-import-example As you can see only main.sass is watched. Modifying other imported sass files do not trigger a css build.

laurentpayot avatar Jun 20 '20 09:06 laurentpayot