PHPStorm-在现有文件上运行Filewatcher? [英] PHPStorm - Run Filewatcher on existing files?
问题描述
我已经在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?
推荐答案
- 在项目视图"面板中选择此类文件/文件夹
- 帮助|查找操作" ( Ctrl + Shift + A ),激活复选框以获得更好的结果
- 搜索"
run file w
"(显然没有引号),然后选择运行文件监视程序条目
- Select such file(s)/folder(s) in Project View panel
- "Help | Find Action" (Ctrl + Shift + A), activate check box for better results
- Search for "
run file w
" (without quotes, obviously) and choose Run File Watchers entry
或者:
- 设置|键盘映射"
- 找到运行文件监视程序操作(在插件|文件监视程序"分支下)
- 分配一些自定义快捷方式
- 在项目视图"面板中选择所需的文件/文件夹
- 使用第3步中的快捷方式
- "Settings | Keymap"
- Find that Run File Watchers action (under "Plugins | File Watchers" branch)
- Assign some custom shortcut
- Select desired file(s)/folder(s) in Project View panel
- Use that shortcut from step 3
或者:
- 设置|菜单和工具栏"
- 项目视图弹出菜单"分支
- 找到所需位置,然后单击添加后..."按钮
- 找到运行文件监视程序操作(在插件|文件监视程序"分支下),然后单击确定"按钮
- 现在可以通过项目视图"面板中的内容菜单访问该操作,并且可以在所需的文件和文件夹上使用该操作.
- "Settings | Menus and Toolbars"
- "Project View Popup Menu" branch
- Find desired location and click on "Add After..." button
- Locate Run File Watchers action (it's under "Plugins | File Watcher" branch) and click on "OK" button
- The action is now accessible via content menu in Project View panel and can be used on desired files and folders.
这篇关于PHPStorm-在现有文件上运行Filewatcher?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!