本文介绍了如何在更改时自动同步/刷新SCSS / CSS文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我的客户从Eclipse切换到了Intellij。在两个IDE中,我都在外部编辑SCSS文件,并在终端中运行指南针监视。这在Eclipse中很有用。在编译SCSS文件后,我立即能够简单地刷新浏览器并查看更改。

Recently my client switched from Eclipse to Intellij. In both IDEs I was editing SCSS files externally and running "compass watch" in terminal. This worked great in Eclipse. immediately after compiling SCSS file I was able to simply refresh browser and see the changes.

在Intellij中,最多需要30秒才能看到更改,或者如果我启用在帧激活时同步文件,我必须先切换到浏览器,然后再返回Intellij,然后再次返回浏览器以强制刷新。第三个选项是手动同步css文件夹,这不方便。当我在Intellij中编辑和编译SCSS文件时遇到了同样的问题。

In Intellij it takes up to 30 seconds to see the changes, or if I enable "synchronize files on frame activation" I have to switch to browser first, then back to Intellij, and then back again to browser in order to force refresh. Third option is to manually sync "css" folder, which is not convenient. I had a same issue when I was editing and compiling SCSS files in Intellij.

如何强制Intellij更快地检测CSS文件更改?

How can I force Intellij to detect CSS file change faster?

推荐答案

我找到了解决方案。

打开设置/文件监视器并转到SCSS。确保输出路径刷新字段的输出值与参数字段相同。

Open "Settings / File Watchers" and go to SCSS. Make sure that field "Output paths to refresh" has the same value for the output as "Arguments" field.

例如,这是我的设置:

参数:

--no-cache --update $FileName$:$FileParentDir$\css\$FileNameWithoutExtension$.css

要刷新的输出路径:

$FileParentDir$\css\$FileNameWithoutExtension$.css

这篇关于如何在更改时自动同步/刷新SCSS / CSS文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 04:34