0

On Visual Studio Code, there is an option to trigger the minify extension only if the minified file already exists (extension JS & CSS Minifier).

enter image description here

But in PhpStorm I couldn't find something like this using the File Watchers UglifyJS and CSSO.

Is there something I can do in these options below to emulate the same VS Code behavior?

enter image description here

enter image description here

TylerH
  • 20,799
  • 66
  • 75
  • 101
  • 1) Exactly the same option -- nope; 2) What exactly the issue are you having with minifying? To me it sounds like there is an issue and you are trying to solve it in VSCode way. There can easily be other ways... 3) And what to do when minified version exists ... but the source has changed? Are you manually deleting those `.min.xxx` files in order to trigger the minifier or what? – LazyOne Jan 03 '23 at 15:49
  • In my NodeJS project, the main file `index.js` is getting minified, but I don't want it to be. My goal is to use this minifying only for static files that I'm gonna serve to the client, not the server side JS. What I used to do in VS Code was to manually minify the file when created, and then let the extension do the rest. – Douglas Vicentini Jan 03 '23 at 16:18
  • 1
    See, there was different reason . So in your case: in the File Watcher, the `Scope` field, click on `...` button and define your own custom scope (e.g. include ALL and exclude those few unwanted ones) and then use it in the file watcher. This way the IDE will not "see" such unwanted file as a target for minification. – LazyOne Jan 03 '23 at 18:55
  • It isn't exactly what I was looking for in the first case, but suits me. Thank you. P.S.: You can add that as an answer. – Douglas Vicentini Jan 04 '23 at 11:31

0 Answers0