lvpro
lvpro

Reputation: 278

PHPStorm - Run Filewatcher on existing files?

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?

Upvotes: 21

Views: 10381

Answers (1)

LazyOne
LazyOne

Reputation: 165118

  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.

Upvotes: 43

Related Questions