Skip to content

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

Closed

Description

@crystalfp

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

Activity

  1. cpoftea commented on Apr 18, 2020

    @cpoftea

    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

  2. crystalfp commented on Apr 19, 2020

    @crystalfp
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions