Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
436 views
in Technique[技术] by (71.8m points)

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
  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.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...