使用sass和指南针配置文件播放框架2

时间:2013-05-28 16:20:57

标签: scala playframework-2.0 sbt compass-sass

我正在使用scala测试内容,玩框架2.1.1并且我想使用指南针插件“compass-normalizer”添加指南针样式表。对于sass部分,我使用的是jlitola plugin

我已经开始使用sass和指南针,但使用指南针插件已经证明对我来说是一场噩梦。我尝试将其添加为红宝石要求:

SassPlugin.sassOptions := Seq("--compass","-r","compass-normalizer")

这只是一次尝试而且显然无法正常工作,因为规范化器需要指南针已经初始化,但是如果我有contrib.rb指南针配置文件,我可以让它从终端工作,我呼叫sass #sassfile# --compass 。 以这种思维方式,我尝试在play项目中添加contrib.rb文件而没有运气。我尝试将它添加到应用程序,conf和项目文件夹中,并在所有文件夹中运气相同。

有人能告诉我我做错了什么吗?

1 个答案:

答案 0 :(得分:1)

看起来它在运行时只使用“当前工作目录”(参见:https://github.com/jlitola/play-sass/blob/master/src/main/scala/SassCompiler.scala#L16)。这是使用shady隐式转换Seq[String] => ProcessBuilder

因此,您可以将contrib.rb文件放在默认目录中(应该是您运行sbt的位置)并完成工作。如果没有,根据JVM文档:

The default value is the current working directory of the current process, usually the     directory named by the system property user.dir.

所以你可以创建一个在sbt中打印它的任务来查看它是什么:

TaskKey[Unit]("show-user-dir") := println(sys.props("user.dir")