0

I've read this question: How to Minify CSS with SCSS File Watcher in PhpStorm IDE.

And it was very helpful. But I want to have a normal stylesheet, where I can see the lines in development. And I want a minified stylesheet for the live environment.

Can this be done with 1 file watcher? Because now I have 2, and it creates 2 .map files: style.css.map and style.min.css.map. I don't like that.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Refilon
  • 3,334
  • 1
  • 27
  • 51
  • 1
    Tell it not to produce `.map` file for the second one? – LazyOne Jun 26 '17 at 18:26
  • 1
    SCSS compiler can't produce both non-minified and minified CSS at the same time. if you need a single file watcher, you can create a batch script that would run SCSS for your .scss file to produce a .css and then run some uglifier (YUI compressor, etc) on generated file, and configure this script as a watcher. or, use a build tool (gulp/grunt/etc) to pertform both tasks, and either set them up as watchers, or use their `watch` tasks – lena Jun 26 '17 at 20:34

1 Answers1

0

I've got it working now. Like @lazyone said, just don't generate a .map for the minified sheet.

This is how you do it:

In arguments field, you add: --no-cache --style compressed --update --sourcemap=none $FileName$:../$FileNameWithoutExtension$.min.css

the sourcemap=none part should do the trick.

Refilon
  • 3,334
  • 1
  • 27
  • 51