有没有一种预定义目录的方法供SASS观看? [英] Is there a way to pre-define directories for SASS to watch?

查看:46
本文介绍了有没有一种预定义目录的方法供SASS观看?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始在我的Web开发中使用SASS.到目前为止,我发现它是一个非常有用的实用程序,但是我遇到了一个较小的可用性问题.

I have recently started using SASS in my web development. Thus far, I've found it to be a very useful utility, however I have run into a minor usibility issue.

我正在工作的这个网站在多个位置都有SASS文件,例如在/css 以及/blog/css 中.

This website I am working on has SASS files in multiple locations, for example in /css as well as in /blog/css.

当前,要让sass监视两个目录,我需要创建两个不同的终端选项卡,并在其中运行 sass --watch css/:css/ sass --watch博客/css/:blog/css/.

Currently, to keep sass watching both directories, I need to create two different terminal tabs and run sass --watch css/:css/ on one, and sass --watch blog/css/:blog/css/ on the other.

如果我可以制作文件或以下格式的文件,那就太好了

It would be awesome if I could make a file or something of the following format:

css/:css/
blog/css/:blog/css/

然后将这个配置文件传递给sass,让它监视两个位置.这可能吗?

And then just pass this config file to sass and have it watch both locations. Is this possible?

推荐答案

您可以使用

You could use foreman to run multiple processes:

gem install foreman

在根目录中创建一个 Procfile ,并按照以下内容添加内容:

Create a Procfile in the root directory and add something along these lines:

sass:  sass --watch css/:css/
sass: sass --watch blog/css/:blog/css/

要同时使用两者,请使用:

To start both use:

foreman start

这篇关于有没有一种预定义目录的方法供SASS观看?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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