PHPStorm-在现有文件上运行Filewatcher? [英] PHPStorm - Run Filewatcher on existing files?

查看:159
本文介绍了PHPStorm-在现有文件上运行Filewatcher?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在PHPStorm中安装了nodejs插件,并设置了yuicompressor npm来最小化css/js.

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

我使文件监视程序正常工作,以便每当我对项目中的.css/.js文件进行更改时,都会自动生成.min.css文件,但是请注意,如果进行更改,文件监视程序只会启动现有文件到文件.

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.

因此,如果项目中已经存在不需要任何更改的.css/.js文件,则除非您对要缩小的每个文件进行更改,否则新定义的文件监视程序将不会在它们上运行(或接触其他外部方式).

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).

假设您有一个不需要更改的现有.css/.js文件的现有项目,是否有一种简便的方法来运行PHPStorm File Watchers,而无需首先更改文件?

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?

推荐答案

  1. 在项目视图"面板中选择此类文件/文件夹
  2. 帮助|查找操作" ( Ctrl + Shift + A ),激活复选框以获得更好的结果
  3. 搜索"run file w"(显然没有引号),然后选择运行文件监视程序条目
  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


或者:

  1. 设置|键盘映射"
  2. 找到运行文件监视程序操作(在插件|文件监视程序"分支下)
  3. 分配一些自定义快捷方式
  4. 在项目视图"面板中选择所需的文件/文件夹
  5. 使用第3步中的快捷方式
  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


或者:

  1. 设置|菜单和工具栏"
  2. 项目视图弹出菜单"分支
  3. 找到所需位置,然后单击添加后..."按钮
  4. 找到运行文件监视程序操作(在插件|文件监视程序"分支下),然后单击确定"按钮
  5. 现在可以通过项目视图"面板中的内容菜单访问该操作,并且可以在所需的文件和文件夹上使用该操作.
  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.

这篇关于PHPStorm-在现有文件上运行Filewatcher?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆