0

I'm trying to use the File Watcher tool in the Jetbrains IDE (Webstorm and Rider) to automatically minify my .css files and generate .min.css files for them on the whole project.

Thing is, it keeps minifying files that already have .min.css as the extension. So I end up with files like slick.min.min.css. I can't find any option to control what the criteria is for matching files. Is there some option to force it to ignore .min.css files, so I don't get duplicates?

I was following this guide here: https://www.jetbrains.com/help/idea/compressing-css.html#ws_css_compress_create_file_watcher with some tips from here How to Minify CSS with SCSS File Watcher in PHPStorm IDE

Edis Golubich
  • 187
  • 1
  • 11
  • 1
    See https://stackoverflow.com/a/24938053/783119 . A bit related: https://stackoverflow.com/a/47378091/783119 – LazyOne Jan 06 '21 at 15:38

1 Answers1

3

As .min.css files are still CSS files, your watcher listens to changes in all them ( because watcher Scope == Project files, File type == CSS) and produces the output.

As a workaround I can suggest excluding minified files from watchers processing:

  • create a new scope (Settings | Appearance & Behavior | Scopes) with minified files excluded (like file:.css&&!file:*.min.css)
  • choose this scope as your file watcher Scope
lena
  • 90,154
  • 11
  • 145
  • 150