Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPStorm - Run Filewatcher on existing files?

Tags:

I've installed the nodejs plugin in PHPStorm and setup the yuicompressor npm for minifying css/js.

I got the file watcher working so that .min.css files are produced automatically whenever i make changes to .css/.js files in the project, but notice the file watcher only kicks in on existing files if I make a change to the file.

So, if .css/.js files already exist in a project which do not require any changes, the newly defined file watcher doesn't run on them unless you go in and make a change on each file you want minified (or touched some other external way).

Assuming you have an existing project with existing .css/.js files which don't require changes, is there an easy way to run PHPStorm File Watchers without having to change the files first?

like image 469
lvpro Avatar asked Nov 15 '13 21:11

lvpro


People also ask

How do I enable file watcher?

Automatically run file watchers on savePress Ctrl+Alt+S to open the IDE settings and select Tools | Actions on Save. Enable the File Watcher option and apply the changes.

How do I add a file watcher to Webstorm?

Creating a File WatcherIn the Settings/Preferences dialog ( Ctrl+Alt+S ), click File Watchers under Tools. The File Watchers page opens showing a list of File Watchers that are already configured in this project and in the IDE. and choose the predefined template from which you want to create a File Watcher.


1 Answers

  1. Select such file(s)/folder(s) in Project View panel
  2. "Help | Find Action" (Ctrl + Shift + A), activate check box for better results
  3. Search for "run file w" (without quotes, obviously) and choose Run File Watchers entry

Alternatively:

  1. "Settings | Keymap"
  2. Find that Run File Watchers action (under "Plugins | File Watchers" branch)
  3. Assign some custom shortcut
  4. Select desired file(s)/folder(s) in Project View panel
  5. Use that shortcut from step 3

Alternatively:

  1. "Settings | Menus and Toolbars"
  2. "Project View Popup Menu" branch
  3. Find desired location and click on "Add After..." button
  4. Locate Run File Watchers action (it's under "Plugins | File Watcher" branch) and click on "OK" button
  5. The action is now accessible via content menu in Project View panel and can be used on desired files and folders.
like image 151
LazyOne Avatar answered Oct 18 '22 18:10

LazyOne