Lars
Lars

Reputation: 8458

What names do files have when using sass --watch with directories?

In the Sass manual, it says sass --watch takes 2 arguments: either input_file and output_file, or input_directory and output_directory.

You'll notice when watching files only, we get to explicitly specify what the name of our output file should be. However there's no reference to this when watching directories.

What names do the output files have when watching directories? If we have a file called name.scss, would the output just be name.css? Is there a way to change this?

Upvotes: 0

Views: 109

Answers (1)

cimmanon
cimmanon

Reputation: 68319

Watching a directory will compile all files not prefixed with an underscore as [name].css in the specified directory. This cannot be changed.

You can instead use the underscore prefix to prevent compilation and include that file into a file with the name you do want.

  • _file-with-name-i-dont-want.scss
  • file-with-name-i-want.scss

Contents of file-with-name-i-want.scss:

@import "file-with-name-i-dont-want";

Upvotes: 2

Related Questions