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

1

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.