Skip to content

Sass --watch does not detect @use file changes #2843

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

Closed
crystalfp opened this issue Apr 18, 2020 · 2 comments
Closed

Sass --watch does not detect @use file changes #2843

crystalfp opened this issue Apr 18, 2020 · 2 comments

Comments

@crystalfp
Copy link

My main.scss file contains: @use "../widgets/widget.scss";
and is compiled with sass --style=compressed --watch --color main.scss main.min.css

If I modify main.scss the compiler compiles it.

But if I modify ../widgets/widget.scss nothing happens.

Same problem if I change @use to @import. What am I missing?

sass 1.26.3 on Windows 10 64 bits.

Small example (change extension to .zip) bug-sass.txt

@cpoftea
Copy link

cpoftea commented Apr 18, 2020

It's not an issue

You didn't tell 'watcher' to watch you widget.scss. 'Watcher' don't watch imports or modules if you don't tell him.

First, you should rename you widget.scss to _widget.scss to prevent compilation (read here about partials)

Second, you should pass the file to command
sass --style=compressed --watch --color main.scss:main.min.css ../widgets/_widget.scss

@crystalfp
Copy link
Author

Thanks! I will implement your suggestion.
Simply I was convinced that sass compiler could extract the composition tree by following the @use and @include chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants